After upgrading from 1.6 to 2020, I noticed a new feature called Timers (Crons). As I understood it, the feature would allow:
- setting an arbitrary number of timers
- each timer firing at arbitrary times (with millisecond precision)
- when a timer fires, it would execute a specific PHP code, in background
What I discovered, in practice, was that:
- While code in a timer is running, no other timer is firing – so setting up multiple timers is useless, as well as expecting them to fire at a fixed interval, as long as another or a previous timer code is still executing.
- At least when the timer starts, for a few seconds, if not throughout its whole execution, the main application window becomes non-responsive, it loses window decorations, the mouse cursor turns to spinning circle etc. – so if you set a timer code to run every few seconds the application becomes essentially unusable.
- While the timer code is running, it seems that no other pages would be served to the main application (i.e. navigation or ajax calls are paused or seriously slowed down while running code in a timer).
Has anyone else experienced this? Is it something that I’m doing wrong? How are the timers supposed to work? It would seem that only chunks of code that run very seldom and complete very fast would be suitable for running inside a timer, or else the app would look impaired.