Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/flo-bit/contrail. atproto backend in a bottle flo-bit.dev/contrail
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940/** * Start wrangler dev and auto-trigger the cron every 60s. * * Usage: npx tsx scripts/dev.ts */
import { spawn } from "child_process";
async function main() { const wrangler = spawn("npx", ["wrangler", "dev", "--test-scheduled"], { stdio: "inherit", shell: true, });
// Wait for wrangler to start await new Promise((resolve) => setTimeout(resolve, 3000));
console.log("Auto-ingestion started (every 60s)");
const interval = setInterval(async () => { try { await fetch("http://localhost:8787/__scheduled?cron=*/1+*+*+*+*"); } catch { // wrangler not ready yet or shutting down } }, 60_000);
// Trigger once immediately try { await fetch("http://localhost:8787/__scheduled?cron=*/1+*+*+*+*"); } catch {}
wrangler.on("exit", () => { clearInterval(interval); process.exit(); });}
main();