Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-8269

cron runs at midnight regarless of setting

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      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.

        Attachments

        1. cron.diff
          0.7 kB
          Mark Nielsen

          Activity

            People

            Assignee:
            poltawski Dan Poltawski
            Reporter:
            bushido Mark Nielsen
            Tester:
            Nobody
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08