I create a MySQL events that run every day start at middle night. Sometimes, the server shuts down at night, then the SQL events lost run on that night. Is there a way to detect if there is a missing run and recall the events again when the server is turn back on?
Asked
Active
Viewed 66 times
0
-
@TimBiegeleisen Thanks, Could you explain more on the service table, I am quite new to SQL database. – Vito Feb 07 '18 at 01:58
-
He probably means: you can add a table where the event stores when it gets executed. You could then schedule the event e.g. hourly and check if it is midnight or if the last midnight run was missed and not yet made up for, and otherwise do not run the actual task code. – Solarflare Feb 07 '18 at 09:16
-
@Solarflare Thanks. I am looking for if there is a built in functions that I can use in my case? – Vito Feb 08 '18 at 01:47
-
MySQL will not catch up on missed events, so there is no built-in-feature for that (although you might argue that some built-in-features require more effort to use than creating a table and 2 lines of code, so it's probably as close to a built-in feature as it gets). – Solarflare Feb 08 '18 at 07:59