D
Deno

help

Denoflare scheduled workers

EEthanThatOneKid9/2/2023
Cloudflare has a cronjob feature for running workers at a scheduled time. Wrangler has a flag wrangler dev --test-scheduled (https://developers.cloudflare.com/workers/runtime-apis/scheduled-event/) allowing users to test their scheduled workers via curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*". I read the Denoflare documentation https://denoflare.dev, but it isn’t very clear how to develop scheduled workers. cc @John Spurlock To clarify, are scheduled workers supported by Denoflare? If not, are scheduled workers within the scope of Denoflare?
JSJohn Spurlock9/3/2023
just define a scheduled handler alongside your module fetch handler like any other worker. Full signature looks like: scheduled(event: ModuleWorkerScheduledEvent, env: MyWorkerEnv, ctx: ModuleWorkerContext): Promise<void>;
No description
JSJohn Spurlock9/3/2023
there's no way to simulate cron events locally - for my workers I just call into common code that's also reachable by an admin endpoint from fetch for easy testing
EEthanThatOneKid9/5/2023
You are correct, it worked! I was able to create a working scheduled function. However, it required at least the adjacent fetch method. At least for me, I have been helped and my question is resolved <:party_deno:1035517691517218847> Resulting deployed worker: https://github.com/acmcsufoss/lc-dailies/blob/b08b4a98c568872f16bc836eaf674df220d02062/cf/dailies/dailies.ts<:cookie_deno:1002977285734932480>

Looking for more? Join the community!

Recommended Posts
How to make a function whose return type is inferred to be the same as an input function'sThis is what I got so far. ```ts type Context = { abc: string, def: boolean } /* HAVE TO Tfresh.gen.ts blankhey folks. I've been using fresh for a while as a hobbist. Recently started a new project using thCan extension state have fields that require passing lifetime?It is possible to pass bounds and parameters to the extension! macro but as far as I see it doesn't Limits for background tasksI was thinking of making a filter page for users of multible game cdns, like steam, epic games, and Compiled binary from Cross-Platform CLI example will not workGoing through https://deno.com/blog/build-cross-platform-cli and running the output file, I get ```SDeno Vite App CLI doesn't match Deploy DocsI hope this is the right channel for this. (Deno team is probably already aware of this, but postingthird party module not updating / releasingDear all, I have just added a github repo , https://github.com/jonasfrey/o_file__wav, added a webhoPossible error in Deno.renameI’ve noticed that `Deno.renameˋ does not actually throw a ˋDeno.errors.AlreadyExists` on Linux and BOutgoing connection over TLS (port 465) from the deno deployment is failingI am trying to send an email via Gmail SMTP. The code is trying to connect to smtp.gmail.com on portsetting module scope variable based on module import pathI have a big utilities file with many helper functions, mostly arround html parsing. Many of which tHow to import a npm package that relies on WasmI'm trying to import `npm:@biscuit-auth/biscuit-wasm@0.4.0` and I wrote the following script: ```TypDeno deploy --allow-write permission.I'm writing a small web app that uses tilia (https://deno.land/x/tilia@0.1.2) to manage a small json