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

Add support for R/5 notation in scheduled tasks

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6
    • Fix Version/s: None
    • Component/s: Tasks
    • Labels:
      None
    • Affected Branches:
      MOODLE_36_STABLE

      Description

      The ability to specify a random value for the time portion of scheduled tasks is extremely useful, but unfortunately it is still not possible to have a task run periodically with a random offset. For example, R/20 for every 20 minutes but not necessarily starting on the hour.

      I'd recommend that we:

      1. modify the R flag to be a calculated time based on a hash of the classname - i.e. pass the classname through crc32(md5($classname)) % 60 to give a minute value
      2. move processing of the R flag to the eval_cron_field function

      This combination of changes will mean that:

      1. we are able to support the R/frequency notation and offset jobs to not occur on the hour; and
      2. jobs have a predictable and repeatable time pattern.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dobedobedoh Andrew Nicols
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: