/__scheduled won’t connect
I can't figure out how to run a cron job on wrangler. I have scheduled default export, and wrangler running with --test-scheduled. It will not connect to localhost:8787/__scheduled. Copilot proposes that I run it in ts-node, but Im using to fetch access tokens from paypal and store it in kv.
4 Replies
helko, I am web dev, specilly blockchain, how can I help you?
"cronDev": "wrangler dev --test-scheduled",
[triggers]
crons =["*/50 * * * *"]
export default {
async scheduled(event: ScheduledEvent, env: Env, ctx: ExecutionContext): Promise<void> {
await cronAuth(env)
},
async fetch(request: Request, env: Env) {
return await app.fetch(request, env);
},
};
I do npm run cronDev and it doesn't connect to :8787/__scheduled
I'm trying to do cron jobs to get new access token for paypal api
copilot says that the cron function will run automatically
is there a way to check if it crashes and exits silently?
Yeah both crons firing automatically, and
ts-node
are hallucinations, gpt is not a problem solver.
What do you see when you run curl localhost:8787/__scheduled
?No server connection. im also running windows and have to pass ip param to wrangler dev. i guess ill try different OS or pass the ip.
I wasn't running latest wrangler.