Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6
-
None
-
All
-
Any
-
MOODLE_16_STABLE
-
MOODLE_17_STABLE, MOODLE_18_STABLE
Description
I'm trying to get the stats to work on a 1.6.1+ install (also 1.6.2). It seems to run away and never return. I set the stats settings so that it only went back a week, but it still never seems to end.
Info:
1. Site has about 125 courses.
2. 800 users.
3. Stats settings are set to look one week back and run no longer than an hour.
4. After running for more than an hour, the 'stats_monthly' table has 2,344,571 records in it (it started empty), 'stats_daily', 'stats_user_daily' and 'stats_user_monthly' are empty, 'stats_user_weekly' has 195 records, and 'stats_weekly' has 136 records.
5. If I access the stats functions, I get the message "There is no available data to display, sorry".
After running some tests we discovered that the run ends up in an infinite loop in the 'stats_cron_monthly' function. In particular, the iterator of the loop, function stats_get_next_monthend, never increments the value. It stays the same.
The function stats_get_next_monthend is doing some funky stuff with timestamps. The code reads:
function stats_get_next_monthend($lastmonth) {
return stats_getmidnight(strtotime(date('1-M-Y',$lastmonth).' +1 month'));
}
Attachments
Issue Links
- has a non-specific relationship to
-
MDL-7272 Remove custom timezone handling when PHP5 is required
-
- Closed
-
- has been marked as being related by
-
MDL-7385 "Statistics is currently in catchup mode. So far 0 day(s) have been processed and 365 are pending "doesn't catch up
-
- Closed
-
- is duplicated by
-
MDL-6310 stats_cron_monthly infinite loop for negative timezones
-
- Closed
-