summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/leap/soledad/server/__init__.py4
-rw-r--r--server/src/leap/soledad/server/sync.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/server/src/leap/soledad/server/__init__.py b/server/src/leap/soledad/server/__init__.py
index 58f2b0b1..1b795016 100644
--- a/server/src/leap/soledad/server/__init__.py
+++ b/server/src/leap/soledad/server/__init__.py
@@ -111,7 +111,6 @@ from leap.soledad.server.sync import (
from leap.soledad.common import SHARED_DB_NAME
from leap.soledad.common.couch import CouchServerState
-from leap.soledad.server.caching import get_cache_for
old_tsafe = tsafe
@@ -304,8 +303,7 @@ def load_configuration(file_path):
def application(environ, start_response):
conf = load_configuration('/etc/leap/soledad-server.conf')
- cache = get_cache_for('replica_cache')
- state = CouchServerState(conf['couch_url'], cache=cache)
+ state = CouchServerState(conf['couch_url'])
# WSGI application that may be used by `twistd -web`
application = GzipMiddleware(
SoledadTokenAuthMiddleware(SoledadApp(state)))
diff --git a/server/src/leap/soledad/server/sync.py b/server/src/leap/soledad/server/sync.py
index 64f7e4e7..262b6769 100644
--- a/server/src/leap/soledad/server/sync.py
+++ b/server/src/leap/soledad/server/sync.py
@@ -20,6 +20,7 @@ Server side synchronization infrastructure.
from u1db import sync, Document
from u1db.remote import http_app
from leap.soledad.server.state import ServerSyncState
+from leap.soledad.server.caching import get_cache_for
MAX_REQUEST_SIZE = 200 # in Mb
@@ -188,6 +189,8 @@ class SyncResource(http_app.SyncResource):
db, self.replica_uid = self.state.ensure_database(self.dbname)
else:
db = self.state.open_database(self.dbname)
+ cache = get_cache_for('db-' + sync_id + db.replica_uid)
+ db._cache = cache
# validate the information the client has about server replica
db.validate_gen_and_trans_id(
last_known_generation, last_known_trans_id)