summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-03-22 00:05:40 -0300
committerdrebs <drebs@leap.se>2017-04-04 18:27:37 +0200
commit6d26d440a278ad4cd2ed9edb3bb3e7c97a12b6e8 (patch)
treeb94f38adef3d4fb3596f237b265694c9e1575c42
parente90a424575b04c99696805adbd2cd01a0f4c7e46 (diff)
[refactor] change size into a required parameter where it is necessary
-rw-r--r--client/src/leap/soledad/client/_blobs.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/client/src/leap/soledad/client/_blobs.py b/client/src/leap/soledad/client/_blobs.py
index 92aa42cf..eb09d69f 100644
--- a/client/src/leap/soledad/client/_blobs.py
+++ b/client/src/leap/soledad/client/_blobs.py
@@ -164,7 +164,7 @@ class BlobManager(object):
return self.local.close()
@defer.inlineCallbacks
- def put(self, doc):
+ def put(self, doc, size):
fd = doc.blob_fd
# TODO this is a tee really, but ok... could do db and upload
# concurrently. not sure if we'd gain something.
@@ -407,9 +407,10 @@ def testit(reactor):
def _put(blob_id, payload):
logger.info(":: Starting full put: %s" % blob_id)
manager = _manager()
+ size = os.path.getsize(payload)
with open(payload) as fd:
doc = BlobDoc('mydoc', '1', fd, blob_id=blob_id)
- result = yield manager.put(doc)
+ result = yield manager.put(doc, size=size)
logger.info(":: Result of put: %s" % str(result))
logger.info(":: Finished full put: %s" % blob_id)