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

Refactor scheduled task gui to use NO_OUTPUT_BUFFERING

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.3
    • Component/s: Tasks
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-58177-master

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/May/17