fix: clear progress on clean finish — keywords only reused when previous run was incomplete

This commit is contained in:
2026-03-06 02:26:14 +00:00
parent 97b753d401
commit 2a4fd52d43

View File

@@ -22,7 +22,7 @@ import { verifyLogin as wfLogin, searchWellfound } from './lib/wellfound.mjs';
import { sendTelegram, formatSearchSummary } from './lib/notify.mjs'; import { sendTelegram, formatSearchSummary } from './lib/notify.mjs';
import { DEFAULT_FIRST_RUN_DAYS } from './lib/constants.mjs'; import { DEFAULT_FIRST_RUN_DAYS } from './lib/constants.mjs';
import { generateKeywords } from './lib/keywords.mjs'; import { generateKeywords } from './lib/keywords.mjs';
import { initProgress, isCompleted, markComplete, getKeywordStart, markKeywordComplete, saveKeywords, getSavedKeywords } from './lib/search_progress.mjs'; import { initProgress, isCompleted, markComplete, getKeywordStart, markKeywordComplete, saveKeywords, getSavedKeywords, clearProgress } from './lib/search_progress.mjs';
import { ensureLoggedIn } from './lib/session.mjs'; import { ensureLoggedIn } from './lib/session.mjs';
async function main() { async function main() {
@@ -195,6 +195,7 @@ async function main() {
if (totalAdded > 0) await sendTelegram(settings, summary); if (totalAdded > 0) await sendTelegram(settings, summary);
writeLastRun(true); writeLastRun(true);
clearProgress(); // run finished cleanly — next run starts fresh with new keywords
console.log('\n✅ Search complete'); console.log('\n✅ Search complete');
return { added: totalAdded, seen: totalSeen }; return { added: totalAdded, seen: totalSeen };