From 5568370030aad8cd6403943c2e4252aac65dac50 Mon Sep 17 00:00:00 2001 From: luto Date: Thu, 28 Feb 2019 09:22:41 +0100 Subject: 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 --- bin/qrunner | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bin/qrunner') 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) -- cgit v1.2.3