Multiple notifications sent
mikegull - January 22, 2007 - 18:48
| Project: | Notify |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
Description
Due to timing issues, notify can send multiple notifications to the same user, if cron runs again while the first notification pass is going out. Modified the _cron hook as follows:
function notify_cron() {
if (variable_get('notify_lock', false)) {
watchdog('notify', 'Notify is still locked!');
} else {
variable_set('notify_lock', true);
if (time() - variable_get('notify_send_last', 0) > variable_get('notify_send', 86400)) {
_notify_send();
variable_set('notify_send_last', time());
}
variable_set('notify_lock', false);
}
}Please add back to the main code.

#1
Could you roll a patch? That would help. Thanks.
See http://drupal.org/patch.
#2
http://drupal.org/node/138165 is a duplicate of this one.
what is puzzling is that with D5, the core cron function has been improved, to avoid having multiple instances of cron running, thereby duplicating the job.
If this bug really still existed in D5, more people would have reported it.
@mikegull : do you still experience this problem with D5?
@Shane: do you?
#3
According to issue at 180052, multiple notifications still can occur.
#4
I have multiple notifications on every cron run. Sometimes only two, sometimes as many as eight.
#5
I too have been experiencing similar issues as described at http://drupal.org/node/180052#comment-1108742
#6
I think the logic is worse than that, unfortunately, and I think the proposed patch is just a band-aid.
I'm proposing a different patch.