feat: Enhance Gateway Orchestrator with preopen and open scheduling, add error handling for paused states, and implement new profile management features
This commit is contained in:
@@ -2,6 +2,7 @@ import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { runGatewayApiServer } from './server.js';
|
||||
import { runGatewayOrchestrator } from './orchestrator/orchestratorServer.js';
|
||||
|
||||
export * from './config.js';
|
||||
export * from './context.js';
|
||||
@@ -27,8 +28,11 @@ const isMain = (): boolean => {
|
||||
};
|
||||
|
||||
if (isMain()) {
|
||||
runGatewayApiServer().catch((error) => {
|
||||
console.error('[gateway-api] failed to start', error);
|
||||
const role = process.env.GATEWAY_ROLE ?? 'api';
|
||||
const run = role === 'orchestrator' ? runGatewayOrchestrator : runGatewayApiServer;
|
||||
run().catch((error) => {
|
||||
const prefix = role === 'orchestrator' ? 'gateway-orchestrator' : 'gateway-api';
|
||||
console.error(`[${prefix}] failed to start`, error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user