From ad281d1a9f3a2bb8b051d9649faf5bea5e8586b9 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Fri, 6 Mar 2026 14:51:20 -0800 Subject: [PATCH] Retry stuck/incomplete jobs instead of marking permanently failed Stuck and incomplete jobs now get retried up to max_retries (default 2) before being permanently marked. Honeypots are still permanent. Co-Authored-By: Claude Opus 4.6 --- job_applier.mjs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/job_applier.mjs b/job_applier.mjs index e1ad4fa..9a9513f 100644 --- a/job_applier.mjs +++ b/job_applier.mjs @@ -328,14 +328,27 @@ async function handleResult(job, result, results, settings, profile, apiKey) { break; case 'skipped_honeypot': - case 'stuck': - case 'incomplete': - console.log(` ⏭️ Skipped — ${status}`); + console.log(` ⏭️ Skipped — honeypot`); updateJobStatus(job.id, status, { title, company }); appendLog({ ...job, title, company, status }); results.skipped_other++; break; + case 'stuck': + case 'incomplete': { + const retries = (job.retry_count || 0) + 1; + if (retries <= maxRetries) { + console.log(` ⏭️ ${status} — will retry (attempt ${retries}/${maxRetries})`); + updateJobStatus(job.id, 'new', { title, company, retry_count: retries }); + } else { + console.log(` ⏭️ ${status} — max retries reached`); + updateJobStatus(job.id, status, { title, company }); + appendLog({ ...job, title, company, status }); + } + results.skipped_other++; + break; + } + default: console.warn(` ⚠️ Unhandled status: ${status}`); updateJobStatus(job.id, status, { title, company });