[Neo-report] r1764 vincent - /trunk/neo/client/app.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 16 11:18:02 CET 2010
Author: vincent
Date: Tue Feb 16 11:17:56 2010
New Revision: 1764
Log:
Make "voted_counter" a local variable, as it's only accessed here.
Modified:
trunk/neo/client/app.py
Modified: trunk/neo/client/app.py
==============================================================================
--- trunk/neo/client/app.py [iso-8859-1] (original)
+++ trunk/neo/client/app.py [iso-8859-1] Tue Feb 16 11:17:56 2010
@@ -60,7 +60,6 @@
self.conflict_serial = 0
self.asked_object = 0
self.object_stored_counter = 0
- self.voted_counter = 0
def __getThreadData(self):
thread_id = get_ident()
@@ -576,8 +575,8 @@
ext = dumps(transaction._extension)
oid_list = self.local_var.data_dict.keys()
# Store data on each node
+ voted_counter = 0
cell_list = self._getCellListForTID(self.local_var.tid, writable=True)
- self.local_var.voted_counter = 0
for cell in cell_list:
logging.debug("voting object %s %s" %(cell.getAddress(),
cell.getState()))
@@ -595,10 +594,10 @@
if not self.isTransactionVoted():
raise NEOStorageError('tpc_vote failed')
- self.local_var.voted_counter += 1
+ voted_counter += 1
# check at least one storage node accepted
- if self.local_var.voted_counter == 0:
+ if voted_counter == 0:
raise NEOStorageError('tpc_vote failed')
# Check if master connection is still alive.
# This is just here to lower the probability of detecting a problem
More information about the Neo-report
mailing list