import { redis } from "@/services/redis"; import { loggerModule } from "@/utils/logger"; const shutdownLogger = loggerModule("shutdown"); export function setupShutdown() { process.on("SIGINT", shutdown); process.on("SIGTERM", shutdown); } async function shutdown() { shutdownLogger.debug("Shutting down..."); shutdownLogger.debug("Closing Redis connection..."); await redis.quit(); process.exit(0); }