#handle schedule time execute a function
4 messages · Page 1 of 1 (latest)
and for future if the db server is down during that time, any suggestion to still execute the function eventhough the currentime > checkout time. but when it is done, it will not execute again. so its a one time thing
how precise do you need this timing to be?
The usual naïve solution is to store your "future events" in a database with the time they need to execute at ("scheduledAt") and either a boolean "complete=false" or "completedAt=null" and periodically (once in a day, hour or monute, depending on the needed precision) do a select on the table with "where now() >= scheduledAt AND complete=false". Then process these and mark them with "complete=true"