feat(cron): daily sync.source_doc enqueue

node-cron schedules runSync at 03:00 local time; runSync enqueues
sync.source_doc for every source_docs row with sync_source='url'.
Started from server.js's CLI gate alongside the job queue.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-01 10:14:07 +10:00
parent 8fa7f71694
commit 13fac102dd
6 changed files with 107 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import { mountApi } from './lib/api/index.js';
import * as queue from './lib/jobs/queue.js';
import { registerWorkers } from './lib/jobs/index.js';
import { router as ingestRouter } from './lib/api/routes/ingest.js';
import { startCron } from './lib/cron/index.js';
const VERSION = '2.0.0-alpha.3';
@@ -51,6 +52,7 @@ if (import.meta.url === `file://${process.argv[1]}`) {
.then(registerWorkers)
.then(() => log.info('job queue ready'))
.catch(err => log.error({ err }, 'queue boot failed'));
startCron();
app.listen(port, () => log.info({ port }, 'void-server listening'));
for (const sig of ['SIGTERM', 'SIGINT']) {
process.on(sig, async () => {