Add S3 binary file support and resume download

- ensureLocalFile() downloads binary files (resume PDF) from S3 to temp
- Applier downloads resume from S3 before applying
- Cached in /tmp to avoid re-downloading each run

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 22:07:31 -08:00
parent 534d318953
commit 76c9d0df31
2 changed files with 53 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ process.stdout.write = (chunk, ...args) => { logStream.write(chunk); return orig
process.stderr.write = (chunk, ...args) => { logStream.write(chunk); return origStderrWrite(chunk, ...args); };
import { getJobsByStatus, updateJobStatus, appendLog, loadConfig, isAlreadyApplied, initQueue } from './lib/queue.mjs';
import { ensureLocalFile } from './lib/storage.mjs';
import { acquireLock } from './lib/lock.mjs';
import { createBrowser } from './lib/browser.mjs';
import { ensureAuth } from './lib/session.mjs';
@@ -45,6 +46,12 @@ async function main() {
const settings = loadConfig(resolve(__dir, 'config/settings.json'));
await initQueue(settings);
const profile = loadConfig(resolve(__dir, 'config/profile.json'));
// Ensure resume is available locally (downloads from S3 if needed)
if (profile.resume_path) {
profile.resume_path = await ensureLocalFile('config/Matthew_Jackson_Resume.pdf', profile.resume_path);
}
const answersPath = resolve(__dir, 'config/answers.json');
const answers = existsSync(answersPath) ? loadConfig(answersPath) : [];
const maxApps = settings.max_applications_per_run || Infinity;