digitalpoint
Well-known member
Under 1.2.0, my crons would stop every couple days (mainly because of some Twitter API stuff I was doing and when the Twitter API failed, it would cause an error while running the cron).
This was fixed in 1.2.1, but I still ran into an issue where the cron tasks just stopped working again (only has happened once).
I did some checking around in the code, and I suspect it's the
XenForo_Model_Cron::getMinimumNextRunTime() method that can cause crons to stop working every once in a blue moon.
If the query it runs fails for whatever reason, cron will effectively stop running (maybe there's a locking issue and the query times out... maybe you are in the middle of restarting MySQL so it went away for a split second while that query ran, etc.)
If that query returns nothing, the system sets the next cron run time to January 19, 2038.
In theory that cron should *never* return nothing unless all crons are disabled.
It probably would be a better idea to fall back to a default next run time of something more reasonable... like 15 minutes in the future, rather than never checking again for crons to run until 2038.
This was fixed in 1.2.1, but I still ran into an issue where the cron tasks just stopped working again (only has happened once).
I did some checking around in the code, and I suspect it's the
XenForo_Model_Cron::getMinimumNextRunTime() method that can cause crons to stop working every once in a blue moon.
If the query it runs fails for whatever reason, cron will effectively stop running (maybe there's a locking issue and the query times out... maybe you are in the middle of restarting MySQL so it went away for a split second while that query ran, etc.)
If that query returns nothing, the system sets the next cron run time to January 19, 2038.
In theory that cron should *never* return nothing unless all crons are disabled.
It probably would be a better idea to fall back to a default next run time of something more reasonable... like 15 minutes in the future, rather than never checking again for crons to run until 2038.