summaryrefslogtreecommitdiff
path: root/server/src/leap/soledad/server/_wsgi.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2017-02-17 16:52:07 +0100
committerKali Kaneko <kali@leap.se>2017-02-17 21:03:03 +0100
commit193573cf8d44a3b6a7d8ae0e43988cffb38a428a (patch)
tree08c2b3a4c47c8e21fee25a06f0f8690d4c8ca258 /server/src/leap/soledad/server/_wsgi.py
parentbab34cde11bdeb2810cc9f5d223957af26b2b6d3 (diff)
[bug] reuse wsgi threadpool
it seems evident that the functions were thought to pass a threadpool along, but it finally wasn't properly passed and so there was a new threadpool created to handle every resource. I have removed the creation from the factory because I don't think it makes sense to create a threadpool on the fly, it's prone to errors. - Resolves: #8774
Diffstat (limited to 'server/src/leap/soledad/server/_wsgi.py')
-rw-r--r--server/src/leap/soledad/server/_wsgi.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/server/src/leap/soledad/server/_wsgi.py b/server/src/leap/soledad/server/_wsgi.py
index a719aacb..f6ff6b26 100644
--- a/server/src/leap/soledad/server/_wsgi.py
+++ b/server/src/leap/soledad/server/_wsgi.py
@@ -18,7 +18,6 @@
A WSGI application that serves Soledad synchronization.
"""
from twisted.internet import reactor
-from twisted.python import threadpool
from twisted.web.wsgi import WSGIResource
from leap.soledad.server import SoledadApp
@@ -62,10 +61,5 @@ def init_couch_state(conf):
reactor.stop()
-def get_sync_resource(pool=None):
- if not pool:
- log.warn("NO POOL PASSED, CREATING----------")
- pool = threadpool.ThreadPool()
- reactor.callWhenRunning(pool.start)
- reactor.addSystemEventTrigger('after', 'shutdown', pool.stop)
+def get_sync_resource(pool):
return WSGIResource(reactor, pool, wsgi_application)