JacksonRiver/springboard_modules — pull request #74 by benclark (2012-06-07 20:19:10+00:00)
Title: Fixes for the standalone cron to work correctly when cron is called via Drush

Fixes for the standalone cron to work correctly when cron is called via Drush (versus the cron.php URI).

- Changed queue_processor_cron() to simply skip calling queue_processor_process() when the standalone cron is enabled, rather than having it try to figure out where the request was coming from via a regex on REQUEST_URI.
- Changed queue_processor_menu() to have the queue_processor_cron path call a new menu callback, queue_processor_standalone_cron. It was previously calling queue_processor_cron(), which is why the regex was there in the first place. This new menu callback calls queue_processor_process().
- Rather than wrapping the menu item in an if statement that checks whether standalone cron is enabled, I added an access callback that checks whether standalone cron is enabled. It assumes that if it is, all requests are allowed (i.e. just like it was previously with access callback => TRUE). Now the menu router cache won't need to be rebuilt to turn standalone cron on and off.

This is already in place on IFAW because they needed to turn standalone cron on, but because Acquia runs cron via Drush (and not via cron.php), the normal cron was still running queue_processor_process() despite standalone cron being on.

It's my argument that when standalone cron is on, the hook_cron() implementation should skip any processing. The assumption should be that the queue will be processed by an external cronjob set up by the person checking that "enable standalone cron" box.