()
| 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(); }); |
no test coverage detected