Issue Details (XML | Word | Printable)

Key: MDL-8269
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dan Poltawski
Reporter: Mark Nielsen
Votes: 1
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

cron runs at midnight regarless of setting

Created: 23/Jan/07 07:05 AM   Updated: 14/Jan/08 05:10 AM
Return to search
Component/s: Administration
Affects Version/s: 1.7
Fix Version/s: 1.6.7, 1.7.5, 1.8.5, 1.9, 2.0

File Attachments: 1. File cron.diff (0.7 kB)


Participants: Anthony Borrow, Dan Poltawski, Mark Nielsen, Mark Schumann and Michael Penney
Security Level: None
Resolved date: 14/Jan/08
Affected Branches: MOODLE_17_STABLE
Fixed Branches: MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
Affects Version/s may go back prior to 1.7.

I was writing my own cron code and was using Moodle's for a reference. I wanted one task to be executed at a specific time like Moodle's statistics. I found that Moodle's admin/cron.php uses the following line to get the time:

$timetocheck = strtotime("$CFG->statsruntimestarthour:$CFG->statsruntimestartminute today");

This always seems return midnight. I switch it to the following and I have had more success:

$timetocheck = strtotime("today $CFG->statsruntimestarthour:$CFG->statsruntimestartminute");

A diff off of HEAD is attached.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Mark Nielsen added a comment - 23/Jan/07 07:08 AM
Forgot to add, I have not actually tested the diff I was just looking at the returned time from the strtotime() function in my development code.

Mark Schumann added a comment - 12/Feb/07 06:02 AM
I'm getting a similar issue, although my statistics processing seems to be running at midday.

Michael Penney added a comment - 16/Oct/07 11:20 AM
Was this fixed?

Dan Poltawski added a comment - 14/Jan/08 04:00 AM
Thanks for the report and fix. I've fixed this in CVS (finally!)

Anthony Borrow added a comment - 14/Jan/08 04:44 AM
Dan - I'll just comment rather than re-opening about checking about backporting to 1.7 and 1.6. Peace - Anthony

Dan Poltawski added a comment - 14/Jan/08 05:10 AM
Backported to 1.6/1.7 now