Detect LinkedIn Easy Apply daily limit and stop run

When LinkedIn shows "Easy Apply limit" message, detect it in the
modal-open check, return rate_limited status, put job back in queue,
send Telegram alert, and stop the entire run. Prevents burning retries
and wasting browser sessions when rate limited.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 17:54:45 -08:00
parent 814492d9b6
commit 331408be41
2 changed files with 22 additions and 5 deletions

View File

@@ -201,6 +201,7 @@ async function main() {
]);
result.applyStartedAt = applyStartedAt;
await handleResult(job, result, results, settings, profile, apiKey);
if (results.rate_limited) break;
} catch (e) {
console.error(` ❌ Error: ${e.message}`);
if (e.stack) console.error(` Stack: ${e.stack.split('\n').slice(1, 3).join(' | ').trim()}`);
@@ -241,6 +242,10 @@ async function main() {
} finally {
await browser?.browser?.close().catch(() => {});
}
if (results.rate_limited) {
await sendTelegram(settings, `⚠️ *LinkedIn Easy Apply daily limit reached* — stopping all applications until tomorrow.`).catch(() => {});
break;
}
}
// Final summary + Telegram
@@ -325,6 +330,12 @@ async function handleResult(job, result, results, settings, profile, apiKey) {
break;
}
case 'rate_limited':
console.log(` ⚠️ LinkedIn Easy Apply daily limit reached — stopping run`);
updateJobStatus(job.id, 'new', { title, company, retry_reason: 'rate_limited' });
results.rate_limited = true;
break;
case 'closed':
console.log(` 🚫 Closed — no longer accepting applications`);
updateJobStatus(job.id, 'closed', { title, company });