diff options
| author | Barry Warsaw | 2017-01-28 13:17:25 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2017-01-28 13:19:58 -0500 |
| commit | 7c97e8fbdb90a1a0de1526d7a6f108e95415d6a0 (patch) | |
| tree | d49c10cccf7bfafa08fa7145a5860fa43e5615fb /src/mailman/runners/rest.py | |
| parent | dfb807e04037786a62e7635d0b37e0695a77d5d6 (diff) | |
| download | mailman-7c97e8fbdb90a1a0de1526d7a6f108e95415d6a0.tar.gz mailman-7c97e8fbdb90a1a0de1526d7a6f108e95415d6a0.tar.zst mailman-7c97e8fbdb90a1a0de1526d7a6f108e95415d6a0.zip | |
Diffstat (limited to 'src/mailman/runners/rest.py')
| -rw-r--r-- | src/mailman/runners/rest.py | 8 |
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() |
