early return if worker mode

This commit is contained in:
Alex Holliday committed 2026-06-01 10:45:09 -07:00
1 parent e1558d35b0
commit f74231cf33
2 files changed
+21 -12

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@ import { InitializedServices } from "./config/services.js";
import { logger } from "./utils/logger.js";
import type { Server } from "http";
export const initShutdownListener = (server: Server, services: InitializedServices) => {
export const initShutdownListener = (server: Server | null, services: InitializedServices) => {
const SERVICE_NAME = "Server";
let isShuttingDown = false;
@@ -15,7 +15,7 @@ export const initShutdownListener = (server: Server, services: InitializedServic
logger.info({ message: "Attempting graceful shutdown" });
try {
server.close();
server?.close();
await services.jobQueue.shutdown();
await services.db.disconnect();
logger.info({ message: "Graceful shutdown complete" });