Commit a3238bea authored by Vincent Pelletier's avatar Vincent Pelletier

Factorise self.local_var.tid lookup.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1891 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ed01601f
...@@ -740,13 +740,14 @@ class Application(object): ...@@ -740,13 +740,14 @@ class Application(object):
return return
self._load_lock_acquire() self._load_lock_acquire()
try: try:
tid = self.local_var.tid
# Call function given by ZODB # Call function given by ZODB
if f is not None: if f is not None:
f(self.local_var.tid) f(tid)
# Call finish on master # Call finish on master
oid_list = self.local_var.data_dict.keys() oid_list = self.local_var.data_dict.keys()
p = Packets.AskFinishTransaction(oid_list, self.local_var.tid) p = Packets.AskFinishTransaction(oid_list, tid)
self._askPrimary(p) self._askPrimary(p)
if not self.isTransactionFinished(): if not self.isTransactionFinished():
...@@ -761,11 +762,11 @@ class Application(object): ...@@ -761,11 +762,11 @@ class Application(object):
del self.mq_cache[oid] del self.mq_cache[oid]
else: else:
# Now serial is same as tid # Now serial is same as tid
self.mq_cache[oid] = self.local_var.tid, data self.mq_cache[oid] = tid, data
finally: finally:
self._cache_lock_release() self._cache_lock_release()
self.local_var.clear() self.local_var.clear()
return self.local_var.tid return tid
finally: finally:
self._load_lock_release() self._load_lock_release()
......
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