summaryrefslogtreecommitdiff
path: root/src/mailman/runners/rest.py
diff options
context:
space:
mode:
authorBarry Warsaw2017-01-28 19:04:50 +0000
committerBarry Warsaw2017-01-28 19:04:50 +0000
commit064435abdfd26a77ea1e3c665156ff468ec52ec0 (patch)
tree3540c86b26ab6d8031bf14a2d655966b20cb8f31 /src/mailman/runners/rest.py
parentba08609f28f7193a020a57e90bb887d59f1543bc (diff)
parent91e99645ca80185a30a84744cef441bba96cf6a8 (diff)
downloadmailman-064435abdfd26a77ea1e3c665156ff468ec52ec0.tar.gz
mailman-064435abdfd26a77ea1e3c665156ff468ec52ec0.tar.zst
mailman-064435abdfd26a77ea1e3c665156ff468ec52ec0.zip
Diffstat (limited to 'src/mailman/runners/rest.py')
-rw-r--r--src/mailman/runners/rest.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mailman/runners/rest.py b/src/mailman/runners/rest.py
index a93d164c1..7758972ed 100644
--- a/src/mailman/runners/rest.py
+++ b/src/mailman/runners/rest.py
@@ -21,7 +21,9 @@ import signal
import logging
import threading
+from contextlib import suppress
from mailman.core.runner import Runner
+from mailman.interfaces.runner import RunnerInterrupt
from mailman.rest.wsgiapp import make_server
from public import public
@@ -59,10 +61,12 @@ class RESTRunner(Runner):
def run(self):
"""See `IRunner`."""
- self._server.serve_forever()
+ with suppress(RunnerInterrupt):
+ self._server.serve_forever()
def signal_handler(self, signum, frame):
- super().signal_handler(signum, frame)
+ with suppress(RunnerInterrupt):
+ super().signal_handler(signum, frame)
if signum in (signal.SIGTERM, signal.SIGINT, signal.SIGUSR1):
# Set the flag that will terminate the TCPserver loop.
self._event.set()