~mailman-coders/mailman/2.1

« back to all changes in this revision

Viewing changes to bin/qrunner

  • Committer: luto
  • Date: 2019-02-28 08:22:41 UTC
  • mto: This revision was merged to the branch mainline in revision 1808.
  • Revision ID: m@luto.at-20190228082241-0icxles1amz10sxl
do not lock up a CPU when running qrunner --runner=All

When running qrunner --runner=All on a non-busy system, qrunner starts the runners in an endless loop; eating up a full CPU core doing nothing. This changes the behavior so qrunner sleeps in between runs.

https://mail.python.org/pipermail/mailman-users/2004-September/039401.html

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
import sys
76
76
import getopt
77
77
import signal
 
78
import time
78
79
 
79
80
import paths
80
81
from Mailman import mm_cfg
268
269
                qrunner.run()
269
270
            if once:
270
271
                break
 
272
            if mm_cfg.QRUNNER_SLEEP_TIME > 0:
 
273
                time.sleep(mm_cfg.QRUNNER_SLEEP_TIME)
271
274
        syslog('qrunner', 'Main qrunner loop exiting.')
272
275
    # All done
273
276
    sys.exit(loop.status)