mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
revert a change. fix worker kill
This commit is contained in:
parent
0b8d51d116
commit
004f441d59
@ -158,6 +158,7 @@ class Arbiter(object):
|
||||
self.stop()
|
||||
|
||||
def handle_quit(self):
|
||||
self.stop(False)
|
||||
raise StopIteration
|
||||
|
||||
def handle_int(self):
|
||||
|
||||
@ -53,7 +53,7 @@ class Worker(object):
|
||||
self.address = socket.getsockname()
|
||||
self.tmp = os.tmpfile()
|
||||
self.app = app
|
||||
self.alive = self.tmp.fileno()
|
||||
self.alive = True
|
||||
|
||||
def init_signals(self):
|
||||
map(lambda s: signal.signal(s, signal.SIG_DFL), self.SIGNALS)
|
||||
@ -74,7 +74,7 @@ class Worker(object):
|
||||
spinner = (spinner+1) % 2
|
||||
os.fchmod(self.alive, spinner)
|
||||
|
||||
while True:
|
||||
while self.alive:
|
||||
try:
|
||||
ret = select.select([self.socket], [], [], 2.0)
|
||||
except select.error, e:
|
||||
@ -87,7 +87,7 @@ class Worker(object):
|
||||
# processing clients that more clients are waiting. When
|
||||
# there's no more clients waiting we go back to the select()
|
||||
# loop and wait for some lovin.
|
||||
while True:
|
||||
while self.alive:
|
||||
try:
|
||||
(conn, addr) = self.socket.accept()
|
||||
except socket.error, e:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user