From: stronk7 Date: Tue, 16 Oct 2007 16:10:19 +0000 (+0000) Subject: Move the update of digestmailtimelast to the end of the X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=226a1d9dfc5e64bab68336eaf975b609e3ce5af1;p=moodle.git Move the update of digestmailtimelast to the end of the loop to allow digests to be sent over multiple cron executions if something crash in the middle. MDL-11657 Merged from MOODLE_19_STABLE --- diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 7091a858e8..43077f4e2e 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -512,8 +512,6 @@ function forum_cron() { if ($CFG->digestmailtimelast < $digesttime and $timenow > $digesttime) { - set_config('digestmailtimelast', $timenow); - mtrace('Sending forum digests: '.userdate($timenow, '', $sitetimezone)); $digestposts_rs = get_recordset('forum_queue'); @@ -738,6 +736,8 @@ function forum_cron() { } } } + /// We have finishied all digest emails, update $CFG->digestmailtimelast + set_config('digestmailtimelast', $timenow); } if (!empty($usermailcount)) {