From c7bbe77a720b2ee29541215792793b3a7d8ad0f5 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Wed, 3 Feb 2010 10:43:32 +0100 Subject: [PATCH] timeout should be a float. while i'm here be brutal like a ctrl-c. --- gunicorn/arbiter.py | 4 ++-- gunicorn/worker.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 0b9739dd..bf84be54 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -204,7 +204,7 @@ class Arbiter(object): except StopIteration: break except KeyboardInterrupt: - self.stop() + self.stop(False) sys.exit(-1) except Exception: self.log.info("Unhandled exception in main loop.") @@ -338,7 +338,7 @@ class Arbiter(object): continue worker = Worker(i, self.pid, self.LISTENER, self.modname, - self.timeout/2, self.debug) + self.timeout/2.0, self.debug) pid = os.fork() if pid != 0: self.WORKERS[pid] = worker diff --git a/gunicorn/worker.py b/gunicorn/worker.py index 9f7a65a2..d95f9d18 100644 --- a/gunicorn/worker.py +++ b/gunicorn/worker.py @@ -27,7 +27,8 @@ class Worker(object): 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.id = workerid self.ppid = ppid