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
This commit is contained in:
parent
b30e7d8d2a
commit
1a1ac569ac
@ -21,6 +21,7 @@ import extras
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
import time
|
||||
import yaml
|
||||
|
||||
from turbo_hipster import worker_server
|
||||
@ -53,7 +54,7 @@ def setup_server(args):
|
||||
|
||||
while not server.stopped():
|
||||
try:
|
||||
signal.pause()
|
||||
time.sleep(3)
|
||||
except KeyboardInterrupt:
|
||||
print "Ctrl + C: asking tasks to exit nicely...\n"
|
||||
server.shutdown()
|
||||
|
Loading…
x
Reference in New Issue
Block a user