Hi,

I implemented a custom newslsetter module that uses mime mail, smtp and queue_mail to send a newsletters to about 100 subscribers.
I would like to send all newsletters in one cron run, but cron sends only about 20 mails for each run.

I checked my PHP max execution time, but its very high (900 sec).

I tried the stable version of queue_mail 7.x-1.1 and the latest dev version with the same result.

Is there any configurable time limit that defines how long cron works on the mail queue?

Thanks!

Comments

steven jones’s picture

Title: Cron sends less than 20 mails on each run » Configure the amount of time processing the queue
Category: support » feature

So by default we suggest to Drupal that it should give us the default amount of seconds to process the queue on cron, which is 15 seconds.
I'm not sure if there are modules out there that will alter other module's queue execution times, maybe there should be, but equally maybe we should actually provide a UI for changing our default.

steven jones’s picture

Status: Active » Needs review
StatusFileSize
new1.55 KB

Here's a patch for the testbot to apply, and if I have time I'll test it for real and commit it shortly.

steven jones’s picture

Typo.

steven jones’s picture

Allow 5 second increments.

steven jones’s picture

Status: Needs review » Fixed

Committed to 7.x-1.x. I'll roll a release that includes it shortly.

mabuweb’s picture

Excellent Steven!
I've just updated to the new 7.x-1.x version.
The new "Queue processing time (max)" parameter is working fine for me.
I set it to 180 sec. and sent 100 test mails.
They were all send with one cron run in 90 seconds.

Thank you very much!

Status: Fixed » Closed (fixed)

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

interx’s picture

Just a small addition, the new variable should also be deleted in queue_mail_uninstall().

variable_del('queue_mail_queue_time');
steven jones’s picture

Status: Closed (fixed) » Active

Yup.

steven jones’s picture

Status: Active » Fixed

Thanks, committed that follow up.

Status: Fixed » Closed (fixed)

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