mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-08-14 16:00:25 +02:00
fix: fix retry of non failing job
This commit is contained in:
+11
-2
@@ -44,8 +44,17 @@ router.post("/queue/:name/:repo_id", async (req, res) => {
|
|||||||
if (!job) {
|
if (!job) {
|
||||||
return res.status(404).json({ error: "job_not_found" });
|
return res.status(404).json({ error: "job_not_found" });
|
||||||
}
|
}
|
||||||
await job.retry();
|
try {
|
||||||
res.send("ok");
|
await job.retry();
|
||||||
|
res.send("ok");
|
||||||
|
} catch (error) {
|
||||||
|
try {
|
||||||
|
await job.remove();
|
||||||
|
queue.add(job.name, job.data, job.opts);
|
||||||
|
} catch (error) {
|
||||||
|
res.status(500).send("error_retrying_job");
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
router.delete("/queue/:name/:repo_id", async (req, res) => {
|
router.delete("/queue/:name/:repo_id", async (req, res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user