v1.0.9-beta.017 - fix(scheduler): migrate internal scheduler to BullMQ repeatable jobs
This update replaces the custom setInterval database-polling scheduler with BullMQ's native repeatable jobs mechanism, resolving issues with scheduled jobs failing to fire, experiencing startup delays, or losing interval granularity.
Key changes:
- src/lib/queue.ts: Introduced syncSchedules() to clear and register repeatable BullMQ jobs by reading user preferences from the database, shifting all timekeeping responsibilities to Redis.
- src/lib/cron.ts: Removed the 15-minute setInterval database-polling loop and jobLock mechanics. It now calls syncSchedules() on server boot to initialize jobs while retaining the 60-second active download watcher.
- src/app/api/admin/config/route.ts: Added a hook to trigger syncSchedules() immediately after an admin saves configuration changes, ensuring dynamic schedule updates are synced to Redis in real time.
- src/app/api/cron/route.ts: Stripped out manual job triggering from the external heartbeat endpoint. It now simply purges old logs and delegates all scheduling execution natively to BullMQ.
Resolves #93