-
Bug
-
Resolution: Fixed
-
Minor
-
3.10.7, 3.11.3
-
MOODLE_310_STABLE, MOODLE_311_STABLE
-
MOODLE_310_STABLE, MOODLE_311_STABLE
-
In a scenario where the digest time has passed, but the adhoc task for sending a digest has not yet been processed it is possible for things to happen that will cause the digest mail to not be sent for that day.
The assumptions are that:
- It is after the digest time for the day
- There is a digest adhoc task that has not yet been processed for the day
- A new post has been made on a forum the user is on
When the post is processed by the forum scheduled task for the user with the digest the following happens:
- The new message is added to the forum message queue
- The time for the digest is calculated as being the next day
- A new digest task is sent via \core\task\manager::reschedule_or_queue_adhoc_task();
- Since there is already an existing task rather than creating a new one it changes the run time on the existing task to be the next day.
This results in the user not being sent a digest for the current day, if unlucky this could happen indefinitely for a user.
I would expect that one of the following things should happen in this scenario:
- No change is made to the run time of the digest task (if it will process all the posts in the queue, even if they are after the digest time for the day)
- A new task is added for the next day.
As an example of how this is impacting us:
- Our digest time is set to be 6pm.
- Yesterday at 3pm we had 9100 digests scheduled to be sent
- This morning we had 141 digest adhoc tasks that were created yesterday before the digest time that now have a runtime of today.
- It looked like it took us over an hour to process all the forum digest adhoc tasks, since the earliest posts after the digest time for the users affected were:
- 6:06pm
- 6:18pm
- 7:05pm
This means it is likely that 141 users did not get a daily digest yesterday.