refactor: remove legacy scheduling and analytics code

- Deleted the scheduler module and its associated functions, transitioning to OS-level scheduling.
- Removed the Analytics module and its related interfaces, retaining only a placeholder for backward compatibility.
- Updated ConfigValidator to warn about legacy schedule and analytics configurations.
- Cleaned up StartupValidator to remove diagnostics and schedule validation logic.
- Adjusted Load.ts to handle legacy flags for diagnostics and analytics.
- Removed unused diagnostics capturing functionality.
This commit is contained in:
2025-11-03 19:18:09 +01:00
parent 67006d7e93
commit 43ed6cd7f8
39 changed files with 415 additions and 1494 deletions

View File

@@ -11,25 +11,12 @@ services:
- ./sessions:/app/sessions
environment:
TZ: "America/Toronto" # Set your timezone for proper scheduling (used by image and scheduler)
TZ: "America/Toronto" # Set your timezone for logging (and cron if enabled)
NODE_ENV: "production"
# Force headless when running in Docker (uses Chromium Headless Shell only)
FORCE_HEADLESS: "1"
# ============================================================
# SCHEDULING MODE: Choose one
# ============================================================
# Option 1: Built-in JavaScript Scheduler (default, recommended)
# - No additional setup needed
# - Uses config.jsonc schedule settings
# - Lighter resource usage
#SCHEDULER_DAILY_JITTER_MINUTES_MIN: "2"
#SCHEDULER_DAILY_JITTER_MINUTES_MAX: "10"
#SCHEDULER_PASS_TIMEOUT_MINUTES: "180"
#SCHEDULER_FORK_PER_PASS: "true"
# Option 2: Native Cron (for users who prefer traditional cron)
# Uncomment these lines to enable cron instead:
# Optional: enable in-container cron scheduling
#USE_CRON: "true"
#CRON_SCHEDULE: "0 9 * * *" # Daily at 9 AM (see https://crontab.guru)
#RUN_ON_START: "true" # Run once immediately on container start
@@ -38,5 +25,5 @@ services:
security_opt:
- no-new-privileges:true
# Default: use built-in scheduler (entrypoint handles mode selection)
command: ["npm", "run", "start:schedule"]
# Default: single run per container start
command: ["node", "--enable-source-maps", "./dist/index.js"]