Skip to content

Commit

Permalink
Merge pull request #1 from dekexu/dekexu-patch-1
Browse files Browse the repository at this point in the history
Update gthread.py
  • Loading branch information
dekexu authored Mar 11, 2020
2 parents 8cb2bd2 + 3bf9319 commit 0896392
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gunicorn/workers/gthread.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def finish_request(self, fs):
(keepalive, conn) = fs.result()
# if the connection should be kept alived add it
# to the eventloop and record it
if keepalive:
if keepalive and self.alive:
# flag the socket as non blocked
conn.sock.setblocking(False)

Expand Down Expand Up @@ -307,7 +307,7 @@ def handle_request(self, req, conn):
conn.server, self.cfg)
environ["wsgi.multithread"] = True
self.nr += 1
if self.alive and self.nr >= self.max_requests:
if self.nr >= self.max_requests:
self.log.info("Autorestarting worker after current request.")
resp.force_close()
self.alive = False
Expand Down

0 comments on commit 0896392

Please sign in to comment.