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

Have the cron task manager intelligently ramp down cron as a maintenance window approaches

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Future Dev
    • Tasks

      eg lets say you schedule an outage for 2 hours time:

      # php admin/cli/maintenance.php --enablelater=120
      == Maintenance mode (https://master.localhost) ==
      status: CLI maintenance mode will be enabled on Saturday, 12 April 2025, 4:14 PM 

      Then the task manager can say 'ok only run tasks which we know are very likely to complete withing 2 hours' maybe with some extra 10% margin. It might know from history that course backups and restores might take more than 2 hours 10% of the time so it stops running those but continues to run almost everything else. Then as the time approaches that window keeps shrinking so that cron is full drained by the time the outage actually starts.

      We have all the task history in the logs so we can do this. It might be useful to aggregate the stats for each task ahead of time, eg in MDL-85173, so the task manager doesn't need to calculate all these stats constantly as it is looking for tasks to run.

      This would also be taken into account in the Check API, so that it doesn't alert that cron isn't running when it is intentional.

            Unassigned Unassigned
            brendanheywood Brendan Heywood
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

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