feat(paper): gate canonical execution on durable feed readiness

This commit is contained in:
Boki 2026-10-23 16:50:35 -04:00
parent c01e96e4dd
commit 75abae2cfc
24 changed files with 3720 additions and 66 deletions

View file

@ -151,10 +151,23 @@ async function main() {
const stopped = server?.stop();
let exitCode = 0;
try {
await services.custom?.BacktestRunner?.shutdown();
await services.queueManager?.shutdown();
await services.custom?.ModeManager?.shutdown();
await stopped;
const failures: unknown[] = [];
for (const close of [
() => services.custom?.CanonicalPaperRuntime?.shutdown(),
() => services.custom?.BacktestRunner?.shutdown(),
() => services.queueManager?.shutdown(),
() => services.custom?.ModeManager?.shutdown(),
() => stopped,
]) {
try {
await close();
} catch (error) {
failures.push(error);
}
}
if (failures.length) {
throw new AggregateError(failures, 'Orchestrator shutdown failed');
}
} catch (error) {
exitCode = 1;
services.logger.error('Orchestrator shutdown failed', { error });