Hi, we at work are running our site's cron via script instead of wget to avoid timeouts.
I recently discovered that sendmail was only sending 100 mails per cron, instead of the thousand we configured. It was executing just one batch each time, and then break execution with the message:
"""
Sending interrupted: PHP maximum execution time almost exceeded. Remaining newsletters will be sent during the next cron run. If this warning occurs regularly you should reduce the cron_throttle_setting.
"""
I looked at the module code and found this issue (line 300 simplemail.mail.inc):
if ($elapsed > SIMPLENEWS_SEND_TIME_LIMIT * $max_execution_time) {
watchdog('simplenews', 'Sending interrupted: PHP maximum execution time almost exceeded. Remaining newsletters will be sent during the next cron run. If this warning occurs regularly you should reduce the !cron_throttle_setting.', array('!cron_throttle_setting' => l(t('Cron throttle setting'), 'admin/settings/simplenews/mail')), WATCHDOG_WARNING);
break;
}
Well, the problem here is that the php client hardcodes the max_execution_time setting, deactivating it with a 0.
It's not being checked in the code, so it should be something like this:
if ($max_execution_time && $elapsed > SIMPLENEWS_SEND_TIME_LIMIT * $max_execution_time) {
watchdog('simplenews', 'Sending interrupted: PHP maximum execution time almost exceeded. Remaining newsletters will be sent during the next cron run. If this warning occurs regularly you should reduce the !cron_throttle_setting.', array('!cron_throttle_setting' => l(t('Cron throttle setting'), 'admin/settings/simplenews/mail')), WATCHDOG_WARNING);
break;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | simplenews.admin_.patch | 966 bytes | carlescliment |
Comments
Comment #1
carlescliment commentedComment #2
miro_dietikerRight. This should be corrected.
Could you please check 6.x-2.x and 7.x if this is still an issue?
Comment #3
carlescliment commentedPatch
Comment #4
miro_dietikerApplied to 6.x-2.x...