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

Moodle upgrade resets scheduled tasks lastruntime

    XMLWordPrintable

    Details

      Description

      Upgrade script resets scheduled tasks.

      As part of this reset `nextruntime` is kept, but `lastruntime` is being set to 0.

      This can lead to some issues. For example `\mod_assign\task\cron_task` task checks its last time run https://github.com/moodle/moodle/blob/4ec279a2f063ae890804126e4886f87fe83b5cea/mod/assign/locallib.php#L2521 and then selects records to be processed based on returned value:  https://github.com/moodle/moodle/blob/4ec279a2f063ae890804126e4886f87fe83b5cea/mod/assign/locallib.php#L2696-L2697 so when lastruntime equals 0, the task gets all records including those ones which were already processed as part of previous runs.

       

        Attachments

          Activity

            People

            Assignee:
            mikhailgolenkov Mikhail Golenkov
            Reporter:
            mikhailgolenkov Mikhail Golenkov
            Peer reviewer:
            Brendan Heywood Brendan Heywood
            Integrator:
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Tester:
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              18/Jan/21

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m