Audit fixes: remove dead code, fix run timeout bug, add log tee to all entry points

- Remove unused APPLY_PRIORITY array (replaced by score-based sort)
- Fix run timeout only breaking inner loop — now breaks outer platform loop too
- Remove dead lastProgress variable in easy_apply step loop
- Add stdout/stderr log tee to job_searcher, job_filter, telegram_poller

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 12:13:01 -08:00
parent 9e6b9beb17
commit 51ca354c52
5 changed files with 27 additions and 7 deletions

View File

@@ -10,10 +10,18 @@ loadEnv();
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
import { createWriteStream } from 'fs';
import { loadConfig } from './lib/queue.mjs';
import { processTelegramReplies } from './lib/telegram_answers.mjs';
const __dir = dirname(fileURLToPath(import.meta.url));
// Tee all output to a log file
const logStream = createWriteStream(resolve(__dir, 'data/telegram_poller.log'), { flags: 'w' });
const origStdoutWrite = process.stdout.write.bind(process.stdout);
const origStderrWrite = process.stderr.write.bind(process.stderr);
process.stdout.write = (chunk, ...args) => { logStream.write(chunk); return origStdoutWrite(chunk, ...args); };
process.stderr.write = (chunk, ...args) => { logStream.write(chunk); return origStderrWrite(chunk, ...args); };
const settings = loadConfig(resolve(__dir, 'config/settings.json'));
const answersPath = resolve(__dir, 'config/answers.json');