From f3f37aafae5a354bf62d789322d2cebfaa5cd99c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= <sybren@stuvel.eu>
Date: Tue, 11 Dec 2018 12:48:59 +0100
Subject: [PATCH] Gracefully handle KeyboardInterrupt being thrown when
 shutting down

---
 flamenco_worker/cli.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/flamenco_worker/cli.py b/flamenco_worker/cli.py
index 09d817a8..04f210fb 100644
--- a/flamenco_worker/cli.py
+++ b/flamenco_worker/cli.py
@@ -176,6 +176,8 @@ def main():
         except asyncio.TimeoutError:
             log.debug("Timeout waiting for may-I-run task, "
                       "but that's fine as we're shutting down.")
+        except KeyboardInterrupt:
+            log.info('Keyboard interrupt while shutting down, ignoring as we are shutting down.')
 
         fworker.shutdown()
 
-- 
GitLab