Limit jobs per cron run

ff1 - February 24, 2009 - 22:16
Project:Job queue
Version:5.x-3.0
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:by design
Description

I would like to be able to specify a maximum number of jobs to execute each time cron is run. I regularly need to run code that sends individual emails to 2000+ users. My server has a limit of 500 emails per hour and I need to restrict the emails to stay within this limit.

The queue_mail project is obviously a good candidate for actually queueing the emails, but I would need a change to the job queue module to handle the limited email sending. Is this possible?

If you don't think this is a good idea, do you know if there is another way to achieve this?
Thanks.

#1

wwwoliondorcom - July 30, 2009 - 02:35

Hi,

I would need this function also.

Thanks.

#2

drumm - September 13, 2009 - 01:20
Status:active» by design

These sort of configurations are generally kinda arbitrary, and I don't think users should be exposed to them. I much prefer running as many as are guaranteed to complete within a PHP process and not bothering the user with any questions, it just works. Special cases like this can be adjusted with your PHP max execution time, adjusting how often the system cron runs the Drupal cron, and having your jobs track/log the necessary information.

 
 

Drupal is a registered trademark of Dries Buytaert.