INNER CODE UNIT · TypeScript
shutdown
Beever-AI/beever-atlas · bot/src/index.ts:992
const shutdown = async () => {
console.log("Shutting down bot service...");
if (backgroundSyncTimer) {
clearInterval(backgroundSyncTimer);
backgroundSyncTimer = null;
}
chatManager.stopAdapterRecycle();
discordGateway?.stop();
server.close();
const bot = chatManager.getCurrentBot();
if (bot) {
await bot.shutdown().catch(() => {});
}
process.exit(0);
};
process.on("SIGINT", shutdown);
process.on("SIGTERM", shutdown);