Commit a33c624c authored by Julien Muchembled's avatar Julien Muchembled

client: inline Application._loadFromCache

parent 87eca1e0
...@@ -397,7 +397,11 @@ class Application(ThreadedApplication): ...@@ -397,7 +397,11 @@ class Application(ThreadedApplication):
try: try:
while 1: while 1:
with lock: with lock:
result = self._loadFromCache(oid, tid, before_tid) if tid:
result = self._cache.load(oid, tid + '*')
assert not result or result[1] == tid
else:
result = self._cache.load(oid, before_tid)
if result: if result:
return result return result
load_lock = self._loading[oid][0] load_lock = self._loading[oid][0]
...@@ -465,16 +469,6 @@ class Application(ThreadedApplication): ...@@ -465,16 +469,6 @@ class Application(ThreadedApplication):
Packets.AskObject(oid, at_tid, before_tid), Packets.AskObject(oid, at_tid, before_tid),
askStorage) askStorage)
def _loadFromCache(self, oid, at_tid=None, before_tid=None):
"""
Load from local cache, return None if not found.
"""
if at_tid:
result = self._cache.load(oid, at_tid + '*')
assert not result or result[1] == at_tid
return result
return self._cache.load(oid, before_tid)
def tpc_begin(self, storage, transaction, tid=None, status=' '): def tpc_begin(self, storage, transaction, tid=None, status=' '):
"""Begin a new transaction.""" """Begin a new transaction."""
# First get a transaction, only one is allowed at a time # First get a transaction, only one is allowed at a time
......
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