Skip to content

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

fix: try-catch job removal

Gergo Moricz0d3e09e798ad
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 818cc5d0c..060f67544 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -141,10 +141,14 @@ if (cluster.isMaster) {
console.log(" Removing", jobs.length, "jobs...");
await Promise.all(jobs.map(async x => {
- await wsq.client.del(await x.lockKey());
- await x.takeLock();
- await x.moveToFailed({ message: "interrupted" });
- await x.remove();
+ try {
+ await wsq.client.del(await x.lockKey());
+ await x.takeLock();
+ await x.moveToFailed({ message: "interrupted" });
+ await x.remove();
+ } catch (e) {
+ console.warn("Failed to remove job", x.id, e);
+ }
}));
console.log(" Re-adding", jobs.length, "jobs...");