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

Seemingly unnecessary sleep() in messaging code

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9.10
    • 1.9.9
    • Messages
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      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.

            dougiamas Martin Dougiamas
            ashleyholman Ashley Holman (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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