From 87cfce8eca8d0a93464fedcd3938fb04b7441460 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Fri, 6 Mar 2026 13:39:19 -0800 Subject: [PATCH] Filter: stop spamming Telegram on submit, collect+submit in one run - Removed Telegram notification on batch submit (only notify on collect when results are ready) - After collecting, immediately submit remaining unscored jobs in the same run instead of waiting for next cron cycle Co-Authored-By: Claude Opus 4.6 --- job_filter.mjs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/job_filter.mjs b/job_filter.mjs index 31d315c..f139606 100644 --- a/job_filter.mjs +++ b/job_filter.mjs @@ -266,9 +266,7 @@ async function submit(settings, searchConfig, candidateProfile) { console.log(` ${batchSummary}`); console.log(` Results typically ready in < 1 hour. Next run will collect.`); - await sendTelegram(settings, - `🔍 *AI Filter submitted*\n${filterable.length} jobs across ${submitted.length} tracks\n${batchSummary}` - ).catch(() => {}); + // No Telegram on submit — only notify on collect when results are ready } // --------------------------------------------------------------------------- @@ -296,10 +294,12 @@ async function main() { const state = readState(); if (state?.batches?.length > 0) { - // Phase 1: collect results from all pending batches + // Phase 1: collect results from pending batches await collect(state, settings); - } else { - // Phase 2: submit new batches (one per track) + } + + // Phase 2: submit any remaining unscored jobs (runs after collect too) + if (!readState()) { await submit(settings, searchConfig, candidateProfile); } }