MCPcopy Create free account
hub / github.com/EvoMap/evolver / shutdown

Function shutdown

index.js:1110–1119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1108 // Do NOT add .unref() here -- that would defeat the purpose.
1109
1110 function shutdown() {
1111 if (_keepAliveTimer) { clearInterval(_keepAliveTimer); _keepAliveTimer = null; }
1112 stopLockRefresh();
1113 releaseLock();
1114 // stopHeartbeat() clears the drift detector interval and the heartbeat
1115 // timer, preventing "ghost tick" log noise after exit and ensuring a
1116 // clean state if the process is somehow continued (test harness, etc.).
1117 try { require('./src/gep/a2aProtocol').stopHeartbeat(); } catch (e) {}
1118 try { require('./src/gep/a2aProtocol').stopEventStream(); } catch (e) {}
1119 }
1120 process.on('exit', shutdown);
1121 process.on('SIGINT', () => { shutdown(); process.exit(); });
1122 process.on('SIGTERM', () => { shutdown(); process.exit(); });

Callers 1

mainFunction · 0.85

Calls 3

stopLockRefreshFunction · 0.85
releaseLockFunction · 0.85
stopMethod · 0.45

Tested by

no test coverage detected