fix(orchestrator): own startup and shutdown resources (CL16)
This commit is contained in:
parent
21666242f4
commit
8546fce4a9
8 changed files with 384 additions and 117 deletions
|
|
@ -15,6 +15,7 @@ import { PaperDeploymentHost } from './paper/PaperDeploymentHost';
|
|||
import { AnalyticsService } from './services/AnalyticsService';
|
||||
import { StorageService } from './services/StorageService';
|
||||
import { createBuiltinStrategy } from './strategies/canonical-builtins';
|
||||
import { stopOrchestratorWork } from './runtime';
|
||||
import type { OrchestratorServices as IServiceContainer } from './types';
|
||||
|
||||
export type OrchestratorRole = 'paper' | 'research-only';
|
||||
|
|
@ -203,9 +204,9 @@ export async function registerOrchestratorServices(
|
|||
}
|
||||
services.queueManager?.getQueue('orchestrator', { workers: 1, concurrency: maxConcurrent });
|
||||
} catch (error) {
|
||||
await runner.shutdown().catch(() => {});
|
||||
await paper?.shutdown().catch(() => {});
|
||||
await deploymentHost?.shutdown().catch(() => {});
|
||||
await stopOrchestratorWork(services).catch(cleanupError => {
|
||||
services.logger.error('Orchestrator registration cleanup failed', { cleanupError });
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue