From af9d31f75c7cf452240ce20d680bf3467366cbf2 Mon Sep 17 00:00:00 2001 From: pinks Date: Mon, 11 Sep 2023 01:58:51 +0200 Subject: [PATCH] change hanged jobs to 2 minutes --- tasks/returnHangedJobs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/returnHangedJobs.ts b/tasks/returnHangedJobs.ts index 162198d..9b4adc8 100644 --- a/tasks/returnHangedJobs.ts +++ b/tasks/returnHangedJobs.ts @@ -14,9 +14,9 @@ export async function returnHangedJobs(): Promise { const jobs = await jobStore.getBy("status.type", "processing"); for (const job of jobs) { if (job.value.status.type !== "processing") continue; - // if job wasn't updated for 1 minute, return it to the queue + // if job wasn't updated for 2 minutes, return it to the queue const timeSinceLastUpdateMs = Date.now() - job.value.status.updatedDate.getTime(); - if (timeSinceLastUpdateMs > 60 * 1000) { + if (timeSinceLastUpdateMs > 2 * 60 * 1000) { await job.update({ status: { type: "waiting" } }); logger().warning( `Job for ${