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

tool_task_cronrunning has very tight limits on checking cron interval and expected frequency

XMLWordPrintable

    • MOODLE_311_STABLE
    • MOODLE_311_STABLE
    • MDL-73923_tool_task_cronrunning-has-very-tight-limits-on-checking-cron-interval-and-expected-frequency
    • Hide

      Setup

      1. Make sure the expected cron frequency is set to 60 seconds

        $ php admin/cli/cfg.php --name=expectedcronfrequency --set=60
        

      Test

      1. Run the cli script for the Check API and confirm it is OK. If it's not OK, run a couple of times the cron job ($ php admin/cli/cron.php) and re-run the CLI script for the Check API (after this, it should return OK).

        $ php admin/cli/checks.php
        OK: All 'status' checks ok
        

      2. Confirm that the shell error code was 0:

        $ echo $?
        0
        

      3. Simulate a gap of 130 seconds between two consecutive cron runs and confirm it reports a warning for tool_task_cronrunning

        $ php admin/cli/cfg.php --component=tool_task --name=lastcroninterval --set=130
        $ php admin/cli/checks.php 
        WARNING: Cron running (tool_task_cronrunning)
           Status | Check                                                       
        ----------+--------------------------------------------------------------------
          WARNING | Cron running (tool_task_cronrunning)                        
                  |     There was 2 mins 10 secs between the last two runs of the
                  |     cron maintenance script and it should run every 1 min. We
                  |     recommend configuring it to run more frequently.
        

      4. Confirm that the shell error code was 1:

        $ echo $?
        1
        

      5. Simulate a gap of 90 seconds between two consecutive cron runs and confirm it is OK

        $ php admin/cli/cfg.php --component=tool_task --name=lastcroninterval --set=90
        $ php admin/cli/checks.php 
        OK: All 'status' checks ok
        

      6. Confirm that the shell error code was 0:

        $ echo $?
        0
        

      Show
      Setup Make sure the expected cron frequency is set to 60 seconds $ php admin/cli/cfg.php --name=expectedcronfrequency --set=60 Test Run the cli script for the Check API and confirm it is OK. If it's not OK, run a couple of times the cron job ($ php admin/cli/cron.php) and re-run the CLI script for the Check API (after this, it should return OK). $ php admin/cli/checks.php OK: All 'status' checks ok Confirm that the shell error code was 0: $ echo $? 0 Simulate a gap of 130 seconds between two consecutive cron runs and confirm it reports a warning for tool_task_cronrunning $ php admin/cli/cfg.php --component=tool_task --name=lastcroninterval --set=130 $ php admin/cli/checks.php WARNING: Cron running (tool_task_cronrunning) Status | Check ----------+-------------------------------------------------------------------- WARNING | Cron running (tool_task_cronrunning) | There was 2 mins 10 secs between the last two runs of the | cron maintenance script and it should run every 1 min. We | recommend configuring it to run more frequently. Confirm that the shell error code was 1: $ echo $? 1 Simulate a gap of 90 seconds between two consecutive cron runs and confirm it is OK $ php admin/cli/cfg.php --component=tool_task --name=lastcroninterval --set=90 $ php admin/cli/checks.php OK: All 'status' checks ok Confirm that the shell error code was 0: $ echo $? 0

      The tool_task_cronrunning check has very tight limits for checking the last cron interval and comparing it to the expected frequency. When a cron job should take 1:00 min and the last run was 1:02 min it complains that there was 1:02 between the last two runs of the cron maintenance script and it should run every 1:00.

            Daniel Ziegenberg Daniel Ziegenberg
            Daniel Ziegenberg Daniel Ziegenberg
            Tim Hunt Tim Hunt
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 55 minutes
                55m

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