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

Seemingly unnecessary sleep() in messaging code

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.9
    • Fix Version/s: 1.9.10
    • Component/s: Messages
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Hi,

      This line sleeps for 3 seconds for every user you are messaging:

      message/lib.php:1002: sleep(3);

      eg. messaging 200 students = 10 min wait.

      This is a common use case and has problems with load balancers which can be configured to cut off idle connections after a set time.

      From looking through the commit history, there is no clear reason why the sleep was introduced. It also looks like the 2.0 email plugin doesn't have the sleep.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Oct/10