Make profile shutdown idempotent

This commit is contained in:
2026-07-25 13:55:20 +00:00
parent 74b2db2420
commit e6cedf3b37
2 changed files with 28 additions and 2 deletions
@@ -963,8 +963,12 @@ export class GatewayOrchestrator implements GatewayOrchestratorHandle {
private async stopProfile(profile: GatewayProfileRecord): Promise<void> {
const apiName = buildProcessName(profile.profileName, 'api');
const daemonName = buildProcessName(profile.profileName, 'daemon');
const existingNames = new Set((await this.processManager.list()).map((process) => process.name));
const failures: string[] = [];
for (const name of [apiName, daemonName]) {
if (!existingNames.has(name)) {
continue;
}
try {
await this.processManager.stop(name);
} catch {