()
| 615 | } |
| 616 | |
| 617 | function stop() { |
| 618 | var pids = getRunningPids(); |
| 619 | if (pids.length === 0) { |
| 620 | console.log('[Lifecycle] No running evolver loops found.'); |
| 621 | // Wrap in try/catch: on Windows a concurrently-open file raises EBUSY |
| 622 | // instead of succeeding silently as on Unix. |
| 623 | try { if (fs.existsSync(PID_FILE)) fs.unlinkSync(PID_FILE); } catch (_) {} |
| 624 | return { status: 'not_running' }; |
| 625 | } |
| 626 | // Preserve the existing CLI stop semantics: stop every discoverable loop. |
| 627 | stopPids(pids, { unlinkPidFile: true, unlinkLock: true }); |
| 628 | console.log('[Lifecycle] All stopped.'); |
| 629 | return { status: 'stopped', killed: pids }; |
| 630 | } |
| 631 | |
| 632 | function stopOwnedLoops() { |
| 633 | var ownedPids = getOwnedLoopPids(getRunningPids()); |
no test coverage detected