diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2015-09-07 03:56:02 -0300 |
---|---|---|
committer | Victor Shyba <victor.shyba@gmail.com> | 2015-09-24 19:39:56 -0300 |
commit | 14300959a12e4908df7b00281d2590e627a47ba9 (patch) | |
tree | df05a8a0a9999c7fc1cf7fdd04e4b9d8435ca742 /server/src/leap/soledad/server/__init__.py | |
parent | f9faa007bc0d5d681f85aa246ea05ec5fe35ccc5 (diff) |
[feat] full caching for each sync_id session
The CouchDB backend implementation was accessing CouchDB too many times
for the same values. Those values are known inside the same sync_id,
which is the id of current sync session.
This commit adds caching for all redundant calls to Couch inside the
same sync_id for each replica.
Refactoring is still needed, but for now couch.py works normally as if
caching is not present, while sync.py injects the cache as a attribute
to enable it. This needs a simpler implementation.
Diffstat (limited to 'server/src/leap/soledad/server/__init__.py')
-rw-r--r-- | server/src/leap/soledad/server/__init__.py | 4 |
1 files changed, 1 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))) |