diff options
author | luto <m@luto.at> | 2019-02-28 09:22:41 +0100 |
---|---|---|
committer | luto <m@luto.at> | 2019-02-28 09:22:41 +0100 |
commit | 5568370030aad8cd6403943c2e4252aac65dac50 (patch) | |
tree | 884c14297e3493ddff2ae8d64694527c8507892a | |
parent | dd5dc51fc773b56c6f4b33ab739d2b148ec45337 (diff) | |
download | mailman2-5568370030aad8cd6403943c2e4252aac65dac50.tar.gz mailman2-5568370030aad8cd6403943c2e4252aac65dac50.tar.xz mailman2-5568370030aad8cd6403943c2e4252aac65dac50.zip |
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
-rw-r--r-- | bin/qrunner | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/qrunner b/bin/qrunner index 0ca2f993..911276e3 100644 --- a/bin/qrunner +++ b/bin/qrunner @@ -75,6 +75,7 @@ operation. It is only useful for debugging if it is run separately. import sys import getopt import signal +import time import paths from Mailman import mm_cfg @@ -268,6 +269,8 @@ def main(): qrunner.run() if once: break + if mm_cfg.QRUNNER_SLEEP_TIME > 0: + time.sleep(mm_cfg.QRUNNER_SLEEP_TIME) syslog('qrunner', 'Main qrunner loop exiting.') # All done sys.exit(loop.status) |