Move round scheduler in-app via instrumentation.ts, remove cron endpoint
All checks were successful
Build and Push Docker Image / build (push) Successful in 18s
All checks were successful
Build and Push Docker Image / build (push) Successful in 18s
Round open/close scheduling now runs as a 60s setInterval inside the app process (via instrumentation.ts register hook) instead of needing an external crontab. Removed the /api/cron/round-scheduler endpoint. - DRAFT rounds auto-activate when windowOpenAt arrives - ACTIVE rounds auto-close when windowCloseAt passes - Uses existing activateRound/closeRound from round-engine Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,5 +25,19 @@ export async function register() {
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
|
||||
// Round scheduler: check every 60s for rounds that need to open/close
|
||||
import('./server/services/round-scheduler')
|
||||
.then(({ processScheduledRounds }) => {
|
||||
console.log('[Startup] Round scheduler started (60s interval)')
|
||||
// Run once immediately, then every 60 seconds
|
||||
processScheduledRounds().catch(() => {})
|
||||
setInterval(() => {
|
||||
processScheduledRounds().catch((err) => {
|
||||
console.error('[RoundScheduler] Error:', err)
|
||||
})
|
||||
}, 60_000)
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user