Does MySql event will start if the previous event doesn't finish yet?
-
07-02-2021 - |
Pregunta
Example I have an event that will run every 5 seconds, then the first instance of the event is triggered but more than 5 seconds later the instances still not done executing. What will happen to the event would it execute again after 5 seconds even the first event is not finished yet or it will wait for the first instance of the event to finish before executing?
Thanks
Solución
To quote the manual:
If a repeating event does not terminate within its scheduling interval, the result may be multiple instances of the event executing simultaneously. If this is undesirable, you should institute a mechanism to prevent simultaneous instances. For example, you could use the GET_LOCK() function, or row or table locking.
In other words, the new copy will run.
This could lead to more and more running, so you should worry about it.