xf_phantom
Well-known member
XenForo is calling addon cronjobs from all addons.It doesn't evaluate if the addon is deactivated, which icausing many bad side effects
public function getMinimumNextRunTime()
{
$nextRunTime = $this->_getDb()->fetchOne('
SELECT MIN(entry.next_run)
FROM xf_cron_entry AS entry
LEFT JOIN xf_addon AS addon ON (entry.addon_id = addon.addon_id)
WHERE entry.active = 1
AND (addon.addon_id IS NULL OR addon.active = 1)
');
if ($nextRunTime)
{
return $nextRunTime;
}
else
{
return 0x7FFFFFFF; // no entries to run, return time well in future
}
}
public function getCronEntriesToRun($currentTime = null)
{
$currentTime = ($currentTime === null ? XenForo_Application::$time : $currentTime);
return $this->fetchAllKeyed('
SELECT entry.*
FROM xf_cron_entry AS entry
LEFT JOIN xf_addon AS addon ON (entry.addon_id = addon.addon_id)
WHERE entry.active = 1
AND entry.next_run < ?
AND (addon.addon_id IS NULL OR addon.active = 1)
ORDER BY entry.next_run
', 'entry_id', $currentTime);
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.