5bf6013460
Progressive lesson streaming via onSegment callback (fixes SSE for non-English users — locale was shadowed in lesson-reader useEffect). Adds: BullMQ workers, Redis stream buffer, token budget enforcement, Langfuse tracing, golden-eval runner, Playwright e2e scaffolding, lesson depth/locale/preferences schema, mastery map UI, admin panel (blueprints/users/reports/quality/misconceptions), image queries, source citations, view transitions, reading animations, i18n (next-intl), PDF export, surprise endpoint, and 402 passing unit tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 lines
722 B
TypeScript
20 lines
722 B
TypeScript
import generateLessonWorker from './generate-lesson-job';
|
|
import promoteBlueprintWorker from './promote-blueprint-job';
|
|
import regenerateBlueprintWorker from './regenerate-blueprint-job';
|
|
|
|
console.log('[workers] Running: generate-lesson, promote-blueprint, regenerate-blueprint');
|
|
|
|
async function shutdown(signal: string) {
|
|
console.log(`[workers] ${signal} received — draining and closing workers...`);
|
|
await Promise.all([
|
|
generateLessonWorker.close(),
|
|
promoteBlueprintWorker.close(),
|
|
regenerateBlueprintWorker.close(),
|
|
]);
|
|
console.log('[workers] Shutdown complete.');
|
|
process.exit(0);
|
|
}
|
|
|
|
process.on('SIGTERM', () => void shutdown('SIGTERM'));
|
|
process.on('SIGINT', () => void shutdown('SIGINT'));
|