Murray
06/14/2021, 12:03 PMjed
06/14/2021, 12:37 PMnew Date().toISOString().slice(0, 16)
to create a DO stub from something like 2021-06-14T00:00
, invoke the DO using idFromName
, and persist a reference to the original schedule.
3. run a * * * * *
cron that uses the same logic to generate the current time string, fetch the DO, iterate over storage executing each rule, pinging the account DO to write the next event a la step 1.
4. run deleteAll()
on the cron DO to clean it up.vodyl
06/15/2021, 8:57 AMvodyl
06/15/2021, 9:16 AMawait
from storagePromise should make no difference if all promises are "automatically waitUntil'd".jed
06/15/2021, 11:32 AMbrett
06/15/2021, 11:56 AMawait
, then getting the response (generated after the write await
) guarantees the write completed. If you didn't await
, the write could fail or the machine the DO is on could crash and not complete the write, and you'd never know. But you're correct that it is otherwise equivalent. I'll see about the docs.brett
06/15/2021, 12:00 PMvodyl
06/15/2021, 12:20 PMvodyl
06/15/2021, 12:38 PMbrett
06/15/2021, 12:51 PMVanessaš¦©
06/15/2021, 5:23 PMbrett
06/15/2021, 5:35 PMbrett
06/15/2021, 5:36 PMVanessaš¦©
06/15/2021, 5:37 PMbrett
06/15/2021, 5:40 PMVanessaš¦©
06/15/2021, 5:45 PMbrett
06/15/2021, 5:46 PMVanessaš¦©
06/15/2021, 5:47 PMbrett
06/15/2021, 5:47 PMcarlson
06/16/2021, 12:36 AMCannot read property 'idFromName' of undefined
. I'm using https://github.com/cloudflare/durable-objects-rollup-esm as a template.carlson
06/16/2021, 8:30 AM[env.production.durable_objects]
bindings = [{ name = "INCIDENT", class_name = "Incident" }]
carlson
06/16/2021, 8:32 AMeidam | SuperSaaS
06/16/2021, 8:33 AMReaver
06/16/2021, 2:20 PMGreylock
06/16/2021, 6:43 PMGreylock
06/16/2021, 6:43 PMGreylock
06/16/2021, 6:43 PMGreylock
06/16/2021, 6:44 PMvodyl
06/16/2021, 8:02 PMkristian
06/16/2021, 8:45 PM