Commit 7539342c authored by Vincent Pelletier's avatar Vincent Pelletier

client.app: Simplify code a bit.

parent df0e157f
...@@ -517,8 +517,6 @@ class Application(object): ...@@ -517,8 +517,6 @@ class Application(object):
checksum = ZERO_HASH checksum = ZERO_HASH
else: else:
assert data_serial is None assert data_serial is None
compression = self.compress
compressed_data = data
size = len(data) size = len(data)
if self.compress: if self.compress:
compressed_data = compress(data) compressed_data = compress(data)
...@@ -527,6 +525,9 @@ class Application(object): ...@@ -527,6 +525,9 @@ class Application(object):
compression = 0 compression = 0
else: else:
compression = 1 compression = 1
else:
compression = 0
compressed_data = data
checksum = makeChecksum(compressed_data) checksum = makeChecksum(compressed_data)
txn_context['data_size'] += size txn_context['data_size'] += size
on_timeout = OnTimeout(self.onStoreTimeout, txn_context, oid) on_timeout = OnTimeout(self.onStoreTimeout, txn_context, oid)
...@@ -534,9 +535,7 @@ class Application(object): ...@@ -534,9 +535,7 @@ class Application(object):
txn_context['data_dict'][oid] = data txn_context['data_dict'][oid] = data
# Store data on each node # Store data on each node
txn_context['object_stored_counter_dict'][oid] = {} txn_context['object_stored_counter_dict'][oid] = {}
object_base_serial_dict = txn_context['object_base_serial_dict'] txn_context['object_base_serial_dict'].setdefault(oid, serial)
if oid not in object_base_serial_dict:
object_base_serial_dict[oid] = serial
txn_context['object_serial_dict'][oid] = serial txn_context['object_serial_dict'][oid] = serial
queue = txn_context['queue'] queue = txn_context['queue']
involved_nodes = txn_context['involved_nodes'] involved_nodes = txn_context['involved_nodes']
......
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