MCPcopy Create free account
hub / github.com/agent-tower/core / shutdown

Function shutdown

packages/server/src/cli.ts:206–220  ·  view source on GitHub ↗
(signal: string)

Source from the content-addressed store, hash-verified

204
205 let shuttingDown = false;
206 const shutdown = async (signal: string) => {
207 if (shuttingDown) {
208 console.log('\nForce exit.');
209 process.exit(1);
210 }
211 shuttingDown = true;
212 console.log(`\n${signal} received, shutting down...`);
213 try {
214 await app.close();
215 process.exit(0);
216 } catch (err) {
217 console.error('Shutdown error:', err);
218 process.exit(1);
219 }
220 };
221
222 process.on('SIGTERM', () => shutdown('SIGTERM'));
223 process.on('SIGINT', () => shutdown('SIGINT'));

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected