Needs work
Project:
Poormanscron
Version:
6.x-2.2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2012 at 10:33 UTC
Updated:
22 Jun 2012 at 13:12 UTC
I had problems during the run of a cron job that takes longer than an hour (it sends > 400 mails). The function poormanscron_run_cron_check() in poormanscron.module seems that have a bug.
$threshold_semaphore is used as a boolean. Subtracting it from REQUEST_TIME (not sure where this value is defined) does not make sense. Probably using $cron_threshold was the idea. Sorry for my superficially analysis but I hope this helps.
$threshold_semaphore = variable_get('cron_threshold_semaphore', FALSE);
if ($threshold_semaphore) {
if (REQUEST_TIME - $threshold_semaphore > 3600) {
// Either cron has been running for more than an hour or the semaphore
// was not reset due to a database error.
watchdog('cron', 'Cron has been running for more than an hour and is most likely stuck.', array(), WATCHDOG_ERROR);
// Release the cron threshold semaphore.
variable_del('cron_threshold_semaphore');
}
}
Comments
Comment #1
fbo commentedSeconded, tried changing
if ($time - $threshold_semaphore > 3600) {to
if ($time - $cron_threshold > 3600) {and it seems to have solved the problem