Added extra conditions to loops to prevent infinite loops

ref the same fix made for daily loops already:

   http://moodle.cvs.sourceforge.net/moodle/moodle/lib/statslib.php?r1=1.21.2.4&r2=1.21.2.5
This commit is contained in:
moodler
2006-10-03 01:44:15 +00:00
parent f18c648ae7
commit c8f1d1ca37
+2 -2
View File
@@ -238,7 +238,7 @@ function stats_cron_weekly () {
$weeks = 0;
mtrace("starting at $timestart");
while ($sunday >= $nextsunday) {
while ($sunday > $nextsunday && $timestart < $nextsunday) {
$timesql = " (timeend > $timestart AND timeend < $nextsunday) ";
begin_sql();
@@ -347,7 +347,7 @@ function stats_cron_monthly () {
$months = 0;
mtrace("starting from $timestart");
while ($monthend >= $nextmonthend) {
while ($monthend > $nextmonthend && $timestart < $nextmonthend) {
$timesql = " (timeend > $timestart AND timeend < $nextmonthend) ";
begin_sql();