timeout should be a float. while i'm here be brutal like a ctrl-c.

This commit is contained in:
Benoit Chesneau 2010-02-03 10:43:32 +01:00
parent a57e2ec7e6
commit c7bbe77a72
2 changed files with 4 additions and 3 deletions

View File

@ -204,7 +204,7 @@ class Arbiter(object):
except StopIteration: except StopIteration:
break break
except KeyboardInterrupt: except KeyboardInterrupt:
self.stop() self.stop(False)
sys.exit(-1) sys.exit(-1)
except Exception: except Exception:
self.log.info("Unhandled exception in main loop.") self.log.info("Unhandled exception in main loop.")
@ -338,7 +338,7 @@ class Arbiter(object):
continue continue
worker = Worker(i, self.pid, self.LISTENER, self.modname, worker = Worker(i, self.pid, self.LISTENER, self.modname,
self.timeout/2, self.debug) self.timeout/2.0, self.debug)
pid = os.fork() pid = os.fork()
if pid != 0: if pid != 0:
self.WORKERS[pid] = worker self.WORKERS[pid] = worker

View File

@ -27,7 +27,8 @@ class Worker(object):
PIPE = [] PIPE = []
def __init__(self, workerid, ppid, socket, app, timeout, debug=False): def __init__(self, workerid, ppid, socket, app, timeout, d
ebug=False):
self.nr = 0 self.nr = 0
self.id = workerid self.id = workerid
self.ppid = ppid self.ppid = ppid