Web client users are now notified if the server is shut down forcefully (Ctrl-C, reboot etc)

This commit is contained in:
Griatch 2010-12-11 14:26:57 +00:00
parent 0eb5d29560
commit 7f3633c70a
3 changed files with 14 additions and 6 deletions

View file

@ -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