diff options
author | Victor Shyba <victor1984@riseup.net> | 2017-03-22 00:05:40 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2017-04-04 18:27:37 +0200 |
commit | 6d26d440a278ad4cd2ed9edb3bb3e7c97a12b6e8 (patch) | |
tree | b94f38adef3d4fb3596f237b265694c9e1575c42 /client/src/leap/soledad | |
parent | e90a424575b04c99696805adbd2cd01a0f4c7e46 (diff) |
[refactor] change size into a required parameter where it is necessary
Diffstat (limited to 'client/src/leap/soledad')
-rw-r--r-- | client/src/leap/soledad/client/_blobs.py | 5 |
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) |