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

Allow a 'random' value to be set in scheduled tasks time definition

XMLWordPrintable

    • MOODLE_27_STABLE
    • MOODLE_28_STABLE
    • MDL-47221-master
    • Hide

      Note that testing anything with random values is tricky - theoretically you could get the same values 100x in a row, so remember to repeat if it looks like you are not getting something random.

      1. Edit enrol/imsenterprise/db/tasks.php and change the hour and minute fields to R
      2. Edit enrol/imsenterprise/version.php and increment the version
      3. Observe the scheduled tasks screen for the Enrolment file processing task and note the minute and hour
      4. Edit enrol/imsenterprise/version.php and increment the version
      5. Observe the scheduled tasks screen for the Enrolment file processing task and note the minute and hour - it should have changed
      6. Repeat this a few times and VERIFY the minute and hour are changign to random values
      7. Edit the task and tick the 'reset to defaults' button and VERIFY the time changes to random values
      8. Change your moodle prefix to do a new install - verify that the time for IMS enrollment has changed to a random value.
      9. Run unit tests
      Show
      Note that testing anything with random values is tricky - theoretically you could get the same values 100x in a row, so remember to repeat if it looks like you are not getting something random. Edit enrol/imsenterprise/db/tasks.php and change the hour and minute fields to R Edit enrol/imsenterprise/version.php and increment the version Observe the scheduled tasks screen for the Enrolment file processing task and note the minute and hour Edit enrol/imsenterprise/version.php and increment the version Observe the scheduled tasks screen for the Enrolment file processing task and note the minute and hour - it should have changed Repeat this a few times and VERIFY the minute and hour are changign to random values Edit the task and tick the 'reset to defaults' button and VERIFY the time changes to random values Change your moodle prefix to do a new install - verify that the time for IMS enrollment has changed to a random value. Run unit tests

      Sometimes it would be useful to be able to set a 'random' value for the scheduled tasks time value. i.e. When dealing with remote servers, its useful to avoid every single request from automated checks hitting the server at the same time.

      What i'd like is define a 'random' minute value for my task, then when the task is installed - Moodle will choose a random time to set it in the database for each Moodle install.

      I don't think its necessary for this to be exposed to users (and think its better that its defined in the database as a fixed time), its simply to distribute the timings across Moodle installs.

      I need this for MDL-46210 - I can imagine other uses - like converting the updates API checker.

            poltawski Dan Poltawski
            poltawski Dan Poltawski
            Juan Leyva Juan Leyva
            Marina Glancy Marina Glancy
            Ankit Agarwal Ankit Agarwal
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.