In 5.x and HEAD, you should be able to call this function and cut out a lot of your code: http://api.drupal.org/api/5/function/drupal_cron_run

CommentFileSizeAuthor
#1 poormanscron_drupal_cron_run.patch3.17 KBrobloach

Comments

robloach’s picture

Title: use API function to run cron » Use drupal_cron_run() function to run cron
Version: 7.x-2.x-dev » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new3.17 KB

Testing would be much appreciated.

pwolanin’s picture

quick skim looks good

Leeteq’s picture

Subscribing.

robloach’s picture

Status: Needs review » Fixed
robloach’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev
Status: Fixed » Patch (to be ported)

Oops, this actually needs to be patched into 5.x-1.x-dev.

gpk’s picture

#1 also needs to be applied to HEAD.

[update]

Also note that you currently need to use 6.x-1.x-dev to get this fix, it's not included in 6.x-1.0.

gpk’s picture

Title: Use drupal_cron_run() function to run cron » Use drupal_cron_run() function to run cron (fixes FeedAPI compatibility problem)

Another note: this patch removes the ability of poormanscron to log the progress of cron runs (though it doesn't get rid of the static variable that controls this..). There is also an open core issue for this: #131536: Make cron watchdog more granular and informative.

Also changing title to reflect the fact that this patch enables poormanscron to work with FeedAPI, since using http://api.drupal.org/api/5/function/drupal_cron_run means that the cron_semaphore flag will automatically be set during the cron run.

dave reid’s picture

Title: Use drupal_cron_run() function to run cron (fixes FeedAPI compatibility problem) » Use drupal_cron_run() (fixes FeedAPI compatibility problem and multiple simultaneous runs)
vacilando’s picture

It's not clear to me from the above -- has 6.x-1.x-dev been patched as well?
I'm troubled by the notorious multiple-mail Simplenews problem #361071: Use locking to eliminate duplicate emails from concurrent simplenews cron runs. ...

luco’s picture

+1 here.... thanks

hailaz’s picture

+1 here too

dave reid’s picture

Status: Patch (to be ported) » Fixed

Backported to the 5.x branch and new releases created with this for both branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.