From 0a0800fe63e84a32b78b264ff628b1eb72deb2c5 Mon Sep 17 00:00:00 2001 From: bigeagle Date: Mon, 20 Oct 2014 16:25:50 +0800 Subject: [PATCH] fix process control bug --- tunasync/jobs.py | 3 ++- tunasync/tunasync.py | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tunasync/jobs.py b/tunasync/jobs.py index 3dadb95..116fa0d 100644 --- a/tunasync/jobs.py +++ b/tunasync/jobs.py @@ -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 diff --git a/tunasync/tunasync.py b/tunasync/tunasync.py index e304843..07078e9 100644 --- a/tunasync/tunasync.py +++ b/tunasync/tunasync.py @@ -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))