mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix null timmeout and gunicorn.
if no timeout is given the synchronous worker will never wait and will use the CPU for nothing. This minimal timeout prevent it. fix #567
This commit is contained in:
parent
546c2e71fd
commit
53c4484bb8
@ -26,6 +26,11 @@ class SyncWorker(base.Worker):
|
|||||||
for s in self.sockets:
|
for s in self.sockets:
|
||||||
s.setblocking(0)
|
s.setblocking(0)
|
||||||
|
|
||||||
|
if not self.timeout:
|
||||||
|
# if no timeout is given the worker will never wait and will
|
||||||
|
# use the CPU for nothing. This minimal timeout prevent it.
|
||||||
|
self.timeout = 0.5
|
||||||
|
|
||||||
ready = self.sockets
|
ready = self.sockets
|
||||||
while self.alive:
|
while self.alive:
|
||||||
self.notify()
|
self.notify()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user