Commit 56945d3e authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

add shutdown case

parent cc7f6057
......@@ -809,11 +809,13 @@ class DockerWatcher:
limiter = rate_limit(60)
log.debug("watcher started")
while not self._shutdown:
while not self._shutdown: # pragma: nobranch
next(limiter)
try:
for event in self._client.events(filters={"event": "die"}):
log.debug("event %r", event)
if self._shutdown:
return
log.debug("docker event %r", event)
self._loop.call_soon_threadsafe(self._event, event)
except Exception:
log.exception("docker watcher exception")
......@@ -836,7 +838,7 @@ class DockerWatcher:
if not self._shutdown:
self._shutdown = True
for fut in self._futures.values():
if not fut.done():
if not fut.done(): # pragma: nobranch
fut.set_exception(ShuttingDown())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment