I had the need to limit the number of jobs run not only by time but also number so I didn't reach a threshold on an external API. I was making 1000's of calls to the API a minute when my limit was 200 every 10 minutes and getting locked out for an hour.

Here is a patch to add this functionality. It adds a configuration to the admin screen. It also fixes a php warning when submitting the settings form without any function priority settings.

Cheers,
Neil

CommentFileSizeAuthor
#1 job_queue-max.patch1.36 KBjchan
job_queue-count.patch3.28 KBindytechcook
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jchan’s picture

FileSize
1.36 KB

I was thinking the same thing. My server has a limit on the number of emails sent per hour, so I wanted to use job_queue to stop Drupal from sending out more than that. Emails are the primary thing I use queueing for.

Could have saved myself some time if I had bothered to search here first.

Anyway, since I already made the patch, I'll just put it up here for what it's worth. It does not fix the php warning like Neil's does. It's for version 6.x-3.1.

Jonathan Webb’s picture

+1 - Great feature addition! We are also using this module to send bulk email in batches using "queue mail" (to keep from triggering smtp quotas). I applied indytechcook's patch and it worked like a charm with 6.19

sepla’s picture

Status: Active » Reviewed & tested by the community

Both patches has been successfully tested against 6.x-3.x-dev.
Personally I prefer to use the simple one :) Thank you both.

sinasalek’s picture

+1