Time to check your cron settings!


Category: drupal

One of the stealthy, less publicised changes in Drupal 7 was the amalgamation of 'poormanscron' into core.

Those of you familair with earlier versions of Drupal may have used this method of triggering a cron job when you didn't have access to setup a cron/scheduled task via the server - it is triggered from a user's visit.

Sounds potentially simple, but it can be a nightmare - If your Drupal site has a large amount of modules queueing items for the cronjob it can take minutes to run. Whoever is the unlucky visitor to trigger this will have to wait for the successful cron to return before seeing the page load.

The solution? Simplest method is to visit Configuration -> System -> Cron and turn the cron job off (to never) and then setup a proper scheduled task/cron job on the server itself. Bear in mind, another enhancement to core now means cron jobs have a key! So you will need to visit Reports -> Status reports and view the direct link given on the cron line to use in your cron.

A typical command line for this would be -

wget -O - http://www.yourdomain.com/cron.php?cron_key=xyz

Hope this helps!


Comments

Post new comment

The content of this field is kept private and will not be shown publicly.