Sleep instead of waiting for signal in daemon
The daemon needs to periodically check if the server is still running
so it can exit cleanly instead of waiting for a signal.
Change-Id: I20935773518653916f8ed7d5d3734f7b9e478998
diff --git a/turbo_hipster/cmd/server.py b/turbo_hipster/cmd/server.py
index 0ca6b0a..30d8aaf 100644
--- a/turbo_hipster/cmd/server.py
+++ b/turbo_hipster/cmd/server.py
@@ -21,6 +21,7 @@
import os
import signal
import sys
+import time
import yaml
from turbo_hipster import worker_server
@@ -53,7 +54,7 @@
while not server.stopped():
try:
- signal.pause()
+ time.sleep(3)
except KeyboardInterrupt:
print "Ctrl + C: asking tasks to exit nicely...\n"
server.shutdown()