import { env } from "./config.js"; import { runOnce, startScheduler } from "./scheduler.js"; /** * Entrypoint — `RUN_ONCE=true` runs both jobs a single time and exits * (manual/CI-triggered invocation, `pnpm start`), otherwise starts the * long-lived cron loop (the container's normal mode, see `Dockerfile`). */ if (env.RUN_ONCE) { try { await runOnce(); process.exit(0); } catch (err) { console.error("[tech-step-llm-worker] run failed:", err); process.exit(1); } } else { startScheduler(); }