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

Refactor scheduled task gui to use NO_OUTPUT_BUFFERING

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3
    • 3.3
    • Tasks
    • MOODLE_33_STABLE
    • MOODLE_33_STABLE
    • MDL-58177-master
    • Hide

      1. Edit the code file lib/editor/atto/classes/task/autosave_cleanup_task.php
      2. At the end of the 'execute' funciton, add the following line of code:

      sleep(5);

      3. Log in as admin to Moodle.
      4. Go to page 'Site administration / Server / Scheduled tasks'.
      5. Find the task 'Delete expired autosave drafts from the database. ' near the top of the list.
      6. Click the 'Run now' link next to the task.
      7. Click to confirm that you really want to run it.

      EXPECTED: You should see the first part of the task output appear immediately; then, after a five second delay, you should see the rest of the output and the page finishes. (The important part of this is that the first part appears well before the last part, rather than it all appearing at once.)

      BEFORE FIX: On most systems this worked the same way before, but it was implemented differently, and the progressive output did not work on certain systems (when using nginx server, or buffering for compression)

      NOTE: After finishing testing, remember to remove the added code line.

      Show
      1. Edit the code file lib/editor/atto/classes/task/autosave_cleanup_task.php 2. At the end of the 'execute' funciton, add the following line of code: sleep(5); 3. Log in as admin to Moodle. 4. Go to page 'Site administration / Server / Scheduled tasks'. 5. Find the task 'Delete expired autosave drafts from the database. ' near the top of the list. 6. Click the 'Run now' link next to the task. 7. Click to confirm that you really want to run it. EXPECTED: You should see the first part of the task output appear immediately; then, after a five second delay, you should see the rest of the output and the page finishes. (The important part of this is that the first part appears well before the last part, rather than it all appearing at once.) BEFORE FIX: On most systems this worked the same way before, but it was implemented differently, and the progressive output did not work on certain systems (when using nginx server, or buffering for compression) NOTE: After finishing testing, remember to remove the added code line.

      MDL-55980 introduces a great web gui to run tasks manually, however it should use NO_OUTPUT_BUFFERING instead of the custom buffer and flush code.

      It may also be better to refactor the escaping into mtrace itself and detect output context via CLI_SCRIPT / AJAX_SCRIPT / etc

            quen Sam Marshall
            brendanheywood Brendan Heywood
            Dan Poltawski Dan Poltawski
            David Monllaó David Monllaó
            Jake Dallimore Jake Dallimore
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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