Commit 4f2d91c4 authored by Julien Muchembled's avatar Julien Muchembled

client: fix _cache attribute of Storage

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2714 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent c0b9f5b4
...@@ -35,13 +35,6 @@ def check_read_only(func): ...@@ -35,13 +35,6 @@ def check_read_only(func):
return func(self, *args, **kw) return func(self, *args, **kw)
return wraps(func)(wrapped) return wraps(func)(wrapped)
class DummyCache(object):
def __init__(self, app):
self.app = app
def clear(self):
self.app.mq_cache.clear()
class Storage(BaseStorage.BaseStorage, class Storage(BaseStorage.BaseStorage,
ConflictResolution.ConflictResolvingStorage): ConflictResolution.ConflictResolvingStorage):
"""Wrapper class for neoclient.""" """Wrapper class for neoclient."""
...@@ -64,9 +57,7 @@ class Storage(BaseStorage.BaseStorage, ...@@ -64,9 +57,7 @@ class Storage(BaseStorage.BaseStorage,
))) )))
def __init__(self, master_nodes, name, connector=None, read_only=False, def __init__(self, master_nodes, name, connector=None, read_only=False,
compress=None, logfile=None, verbose=False, compress=None, logfile=None, verbose=False, _app=None, **kw):
_app=None, _cache=None,
**kw):
""" """
Do not pass those parameters (used internally): Do not pass those parameters (used internally):
_app _app
...@@ -81,11 +72,7 @@ class Storage(BaseStorage.BaseStorage, ...@@ -81,11 +72,7 @@ class Storage(BaseStorage.BaseStorage,
if _app is None: if _app is None:
_app = Application(master_nodes, name, connector, _app = Application(master_nodes, name, connector,
compress=compress) compress=compress)
assert _cache is None
_cache = DummyCache(_app)
self.app = _app self.app = _app
assert _cache is not None
self._cache = _cache
# Used to clone self (see new_instance & IMVCCStorage definition). # Used to clone self (see new_instance & IMVCCStorage definition).
self._init_args = (master_nodes, name) self._init_args = (master_nodes, name)
self._init_kw = { self._init_kw = {
...@@ -95,9 +82,12 @@ class Storage(BaseStorage.BaseStorage, ...@@ -95,9 +82,12 @@ class Storage(BaseStorage.BaseStorage,
'logfile': logfile, 'logfile': logfile,
'verbose': verbose, 'verbose': verbose,
'_app': _app, '_app': _app,
'_cache': _cache,
} }
@property
def _cache(self):
return self.app._cache
def _getSnapshotTID(self): def _getSnapshotTID(self):
""" """
Get the highest TID visible for current transaction. Get the highest TID visible for current transaction.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment