mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 18:55:59 +08:00
fix: try-catch job removal
This commit is contained in:
parent
69d724714f
commit
0d3e09e798
@ -141,10 +141,14 @@ if (cluster.isMaster) {
|
|||||||
console.log(" Removing", jobs.length, "jobs...");
|
console.log(" Removing", jobs.length, "jobs...");
|
||||||
|
|
||||||
await Promise.all(jobs.map(async x => {
|
await Promise.all(jobs.map(async x => {
|
||||||
await wsq.client.del(await x.lockKey());
|
try {
|
||||||
await x.takeLock();
|
await wsq.client.del(await x.lockKey());
|
||||||
await x.moveToFailed({ message: "interrupted" });
|
await x.takeLock();
|
||||||
await x.remove();
|
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...");
|
console.log(" Re-adding", jobs.length, "jobs...");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user