Update
This commit is contained in:
		@@ -55,6 +55,7 @@ The application uses `services/config.ts` for centralized configuration manageme
 | 
			
		||||
- `ADMIN_PORT`: Admin panel port (default: 3001)
 | 
			
		||||
- `ADMIN_USERNAME`: Admin panel username (optional, for basic auth)
 | 
			
		||||
- `ADMIN_PASSWORD`: Admin panel password (optional, for basic auth)
 | 
			
		||||
- `DISABLE_INITIAL_BATCH`: Disable initial batch process on startup (default: false)
 | 
			
		||||
- Podcast metadata and other optional settings
 | 
			
		||||
 | 
			
		||||
Configuration is validated on startup. See README.md for complete list.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
import { batchProcess } from "../scripts/fetch_and_generate.js";
 | 
			
		||||
import { config } from "./config.js";
 | 
			
		||||
 | 
			
		||||
interface BatchSchedulerState {
 | 
			
		||||
  enabled: boolean;
 | 
			
		||||
@@ -21,8 +22,15 @@ class BatchScheduler {
 | 
			
		||||
  private readonly SIX_HOURS_MS = 6 * 60 * 60 * 1000; // 6 hours in milliseconds
 | 
			
		||||
 | 
			
		||||
  constructor() {
 | 
			
		||||
    // Start with initial delay and then schedule regular runs
 | 
			
		||||
    this.scheduleInitialRun();
 | 
			
		||||
    // Check if initial run is disabled via environment variable
 | 
			
		||||
    if (config.batch.disableInitialRun) {
 | 
			
		||||
      console.log("⏸️  Initial batch run disabled by configuration");
 | 
			
		||||
      // Still schedule regular runs, just skip the initial one
 | 
			
		||||
      this.scheduleRegularRuns();
 | 
			
		||||
    } else {
 | 
			
		||||
      // Start with initial delay and then schedule regular runs
 | 
			
		||||
      this.scheduleInitialRun();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private scheduleInitialRun() {
 | 
			
		||||
 
 | 
			
		||||
@@ -33,6 +33,11 @@ interface Config {
 | 
			
		||||
    password?: string;
 | 
			
		||||
  };
 | 
			
		||||
  
 | 
			
		||||
  // Batch Processing Configuration
 | 
			
		||||
  batch: {
 | 
			
		||||
    disableInitialRun: boolean;
 | 
			
		||||
  };
 | 
			
		||||
  
 | 
			
		||||
  // File paths
 | 
			
		||||
  paths: {
 | 
			
		||||
    projectRoot: string;
 | 
			
		||||
@@ -92,6 +97,10 @@ function createConfig(): Config {
 | 
			
		||||
      password: import.meta.env["ADMIN_PASSWORD"],
 | 
			
		||||
    },
 | 
			
		||||
    
 | 
			
		||||
    batch: {
 | 
			
		||||
      disableInitialRun: getOptionalEnv("DISABLE_INITIAL_BATCH", "false") === "true",
 | 
			
		||||
    },
 | 
			
		||||
    
 | 
			
		||||
    paths: {
 | 
			
		||||
      projectRoot,
 | 
			
		||||
      dataDir,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user