import generateLessonWorker from './generate-lesson-job'; import promoteBlueprintWorker from './promote-blueprint-job'; console.log('[workers] Running: generate-lesson, promote-blueprint'); async function shutdown(signal: string) { console.log(`[workers] ${signal} received — draining and closing workers...`); await Promise.all([ generateLessonWorker.close(), promoteBlueprintWorker.close(), ]); console.log('[workers] Shutdown complete.'); process.exit(0); } process.on('SIGTERM', () => void shutdown('SIGTERM')); process.on('SIGINT', () => void shutdown('SIGINT'));