Say I create this sleep function that waits for a setTimeout to complete before resolving a promise:
function sleep(milliseconds) {
return new Promise(r=>setTimeout(r, milliseconds));
}
And I want to use it with waitUntil()? How long will it wait for before it’s too long? Or is there almost no limit? Example code to wait for 86400000 ms (24 hours) then execute function dosomething():
waitUntil(sleep(86400000).then(r=>dosomething());
Would 24 hours be too long? What would be too long?
I need to schedule an event from a worker to take place around 60 seconds after script execution. This is because 60 seconds is the longest length of time it takes to delete a key.
I’m not sure how to use a worker create a temporary cron trigger and execute 60 seconds later. But it sounds like that’s what I’ll have to do.