fix(processmanager): Improve process lifecycle handling and cleanup in daemon, monitors and wrappers

This commit is contained in:
2025-08-31 07:45:47 +00:00
parent 8f31672a67
commit 0a75c4cf76
6 changed files with 56 additions and 32 deletions

View File

@@ -499,8 +499,12 @@ export class ProcessManager extends EventEmitter {
*/
public async startAll(): Promise<void> {
for (const [id, config] of this.processConfigs.entries()) {
if (!this.processes.has(id)) {
const monitor = this.processes.get(id);
if (!monitor) {
await this.start(config);
} else if (!monitor.isRunning()) {
// If a monitor exists but is not running, restart the process to ensure a clean start
await this.restart(id);
}
}
}