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_PORT`: Admin panel port (default: 3001)
|
||||||
- `ADMIN_USERNAME`: Admin panel username (optional, for basic auth)
|
- `ADMIN_USERNAME`: Admin panel username (optional, for basic auth)
|
||||||
- `ADMIN_PASSWORD`: Admin panel password (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
|
- Podcast metadata and other optional settings
|
||||||
|
|
||||||
Configuration is validated on startup. See README.md for complete list.
|
Configuration is validated on startup. See README.md for complete list.
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { batchProcess } from "../scripts/fetch_and_generate.js";
|
import { batchProcess } from "../scripts/fetch_and_generate.js";
|
||||||
|
import { config } from "./config.js";
|
||||||
|
|
||||||
interface BatchSchedulerState {
|
interface BatchSchedulerState {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
@ -21,9 +22,16 @@ class BatchScheduler {
|
|||||||
private readonly SIX_HOURS_MS = 6 * 60 * 60 * 1000; // 6 hours in milliseconds
|
private readonly SIX_HOURS_MS = 6 * 60 * 60 * 1000; // 6 hours in milliseconds
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
// 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
|
// Start with initial delay and then schedule regular runs
|
||||||
this.scheduleInitialRun();
|
this.scheduleInitialRun();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private scheduleInitialRun() {
|
private scheduleInitialRun() {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
|
@ -33,6 +33,11 @@ interface Config {
|
|||||||
password?: string;
|
password?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Batch Processing Configuration
|
||||||
|
batch: {
|
||||||
|
disableInitialRun: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
// File paths
|
// File paths
|
||||||
paths: {
|
paths: {
|
||||||
projectRoot: string;
|
projectRoot: string;
|
||||||
@ -92,6 +97,10 @@ function createConfig(): Config {
|
|||||||
password: import.meta.env["ADMIN_PASSWORD"],
|
password: import.meta.env["ADMIN_PASSWORD"],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
batch: {
|
||||||
|
disableInitialRun: getOptionalEnv("DISABLE_INITIAL_BATCH", "false") === "true",
|
||||||
|
},
|
||||||
|
|
||||||
paths: {
|
paths: {
|
||||||
projectRoot,
|
projectRoot,
|
||||||
dataDir,
|
dataDir,
|
||||||
|
Reference in New Issue
Block a user