Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Update queue-worker.ts

Nicolas93657f6a4408
diff --git a/apps/api/src/services/queue-worker.ts b/apps/api/src/services/queue-worker.ts
index 9d536acc6..bff51f74e 100644
--- a/apps/api/src/services/queue-worker.ts
+++ b/apps/api/src/services/queue-worker.ts
@@ -94,6 +94,11 @@ const processJobInternal = async (token: string, job: Job) => {
let isShuttingDown = false;
+process.on("SIGINT", () => {
+ console.log("Received SIGTERM. Shutting down gracefully...");
+ isShuttingDown = true;
+});
+
process.on("SIGTERM", () => {
console.log("Received SIGTERM. Shutting down gracefully...");
isShuttingDown = true;