job_queue handles all queued email sending for og module. it works well. it ha s afew lines of nitfy code which assure that you don't time out in a cron run. if you already wrote your own queueing, then perhaps it isn't needed. but still take a look.

CommentFileSizeAuthor
#2 subscriptions_mail.cron_.196771.2.patch2.74 KBsalvis

Comments

salvis’s picture

Presently, we're sending a configurable number of emails per cron, with a default of 200.
The UI for configuring subscriptions_number_of_mails isn't there yet though.

    if ((timer_read('page') / 1000) > (ini_get('max_execution_time') / 2)) {
      break; // Stop once we have used over half of the maximum execution time or exceeds the original number of jobs.
    }

Yes, that's an interesting idea, thanks! Let's see what chx thinks of it...

salvis’s picture

Title: Look into job_queue module for cron based send » Use a timer to control the cron job
Version: » 5.x-2.0-beta11
Status: Active » Needs review
StatusFileSize
new2.74 KB

Please try the attached patch, especially those of you with sizeable "test sites," like introfini. :-)

Every cron run creates a watchdog message like the following:

Subscriptions sent N single and M digest messages in S of T seconds; X queue items left.

I'd like to get an idea of what kind of numbers you're seeing.

(I'll add an option to suppress the watchdog message.)

salvis’s picture

Has anyone tried this yet?

salvis’s picture

Version: 5.x-2.0-beta11 » 5.x-2.0-beta12
Status: Needs review » Fixed

It's implemented now. There's also a new cron message that will show you the relevant numbers. I'd be interested to see some numbers from those of you who are running 2.0 on big "test sites"...

Also see #233079: status of queuing and cron UI or controls?.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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