INNER CODE UNIT · TypeScript
shutdown
stablyai/orca · cloud/apps/relay/src/index.ts:122
const shutdown = (): void => {
clearInterval(cleanupTimer)
if (assignmentCleanupTimer) clearInterval(assignmentCleanupTimer)
if (inventorySnapshotTimer) clearInterval(inventorySnapshotTimer)
if (migrationInventoryTimer) clearInterval(migrationInventoryTimer)
observability.stop()
heartbeat?.stop()
regionalRehomeWorker?.stop()
sessions.drain(0)
server.close(() => void database.close())
}
process.once('SIGTERM', shutdown)
process.once('SIGINT', shutdown)