Web client users are now notified if the server is shut down forcefully (Ctrl-C, reboot etc)
This commit is contained in:
parent
0eb5d29560
commit
7f3633c70a
3 changed files with 14 additions and 6 deletions
|
|
@ -45,7 +45,7 @@ class DjangoWebRoot(resource.Resource):
|
|||
pool = threadpool.ThreadPool()
|
||||
pool.start()
|
||||
# Set it up so the pool stops after e.g. Ctrl-C kills the server
|
||||
reactor.addSystemEventTrigger('after', 'shutdown', pool.stop)
|
||||
reactor.addSystemEventTrigger('after', 'shutdown', pool.stop)
|
||||
# combine twisted's wsgi resource with django's wsgi handler
|
||||
wsgi_resource = WSGIResource(reactor, pool, WSGIHandler())
|
||||
return wsgi_resource
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue