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

Refactor scheduled task gui to use NO_OUTPUT_BUFFERING

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 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.

    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

              quen Sam Marshall
              brendanheywood Brendan Heywood
              Dan Poltawski Dan Poltawski
              David Monllaó David Monllaó
              Jake Dallimore Jake Dallimore
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                15/May/17