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 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 13:39:19 -08:00
parent c99ea10585
commit 87cfce8eca

View File

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