fix process control bug

This commit is contained in:
bigeagle 2014-10-20 16:25:50 +08:00
parent ef48f8be47
commit 0a0800fe63
2 changed files with 3 additions and 5 deletions

View File

@ -3,6 +3,7 @@
import sh
import sys
import signal
import Queue
def run_job(sema, child_q, manager_q, provider):
@ -56,7 +57,7 @@ def run_job(sema, child_q, manager_q, provider):
if msg == "terminate":
manager_q.put((provider.name, "QUIT"))
break
except:
except Queue.Empty:
pass

View File

@ -207,10 +207,7 @@ class TUNASync(object):
signal.signal(signal.SIGUSR2, self.reload_mirrors_force)
while 1:
try:
name, status = self.channel.get()
except:
continue
name, status = self.channel.get()
if status == "QUIT":
print("New configuration applied to {}".format(name))