Cap external job classification to 50 per run

Prevents spending hours classifying unknown_external jobs at the
end of a long search run. Remaining get classified on next run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 22:17:44 -08:00
parent 2e61854be5
commit 105d82f00c

View File

@@ -224,9 +224,12 @@ async function main() {
platformsRun.push('LinkedIn'); platformsRun.push('LinkedIn');
// Classify unknown_external jobs using the existing LinkedIn browser session // Classify unknown_external jobs using the existing LinkedIn browser session
const unclassified = getJobsByStatus('new').filter(j => j.apply_type === 'unknown_external' && !j.apply_url); // Cap at 50 per run — each one requires a click + redirect wait
const MAX_CLASSIFY = 50;
const allUnclassified = getJobsByStatus('new').filter(j => j.apply_type === 'unknown_external' && !j.apply_url);
const unclassified = allUnclassified.slice(0, MAX_CLASSIFY);
if (unclassified.length > 0) { if (unclassified.length > 0) {
console.log(`\n🔍 Classifying ${unclassified.length} external jobs...`); console.log(`\n🔍 Classifying ${unclassified.length}/${allUnclassified.length} external jobs...`);
try { try {
const { classified, remaining } = await classifyExternalJobs(liBrowser.page, unclassified, async (job, applyType, applyUrl) => { const { classified, remaining } = await classifyExternalJobs(liBrowser.page, unclassified, async (job, applyType, applyUrl) => {
await updateJobStatus(job.id, 'new', { apply_type: applyType, apply_url: applyUrl }); await updateJobStatus(job.id, 'new', { apply_type: applyType, apply_url: applyUrl });