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 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 14:51:20 -08:00
parent d0a40e4654
commit ad281d1a9f

View File

@@ -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 });