Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Have the WSGI loader call shutdown() on a socket after every request …

…just in case the app spawns a child process that keeps the socket open.
  • Loading branch information...
commit 05042640512d4b7ca8ccf166a236fb2d77974ebb 1 parent fcc3403
@FooBarWidget FooBarWidget authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 helper-scripts/wsgi-loader.py
View
6 helper-scripts/wsgi-loader.py
@@ -124,6 +124,12 @@ def main_loop(self):
logging.exception("WSGI application raised an exception!")
finally:
try:
+ # Shutdown the socket like this just in case the app
+ # spawned a child process that keeps it open.
+ client.shutdown(socket.SHUT_WR)
+ except:
+ pass
+ try:
client.close()
except:
pass
Please sign in to comment.
Something went wrong with that request. Please try again.