summaryrefslogtreecommitdiff
path: root/src/leap/soledad/client/_db/blobs/__init__.py
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-10-25 22:35:32 -0300
committerVictor Shyba <victor1984@riseup.net>2017-10-27 16:01:48 -0300
commit5faf22e4603d8130d11890f43f2f002821e8a976 (patch)
tree8e0a849b96d1540e4d2c695abb000eca3534a480 /src/leap/soledad/client/_db/blobs/__init__.py
parent3230c9388729ae784c05575a2021c9d0995faa13 (diff)
[refactor] add a table for sync_status
As defined in #8970, this table and the new module will ease adding sync features such as priority queues and streaming. --Resolves: #8970
Diffstat (limited to 'src/leap/soledad/client/_db/blobs/__init__.py')
-rw-r--r--src/leap/soledad/client/_db/blobs/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/leap/soledad/client/_db/blobs/__init__.py b/src/leap/soledad/client/_db/blobs/__init__.py
index 0120b222..3c8facba 100644
--- a/src/leap/soledad/client/_db/blobs/__init__.py
+++ b/src/leap/soledad/client/_db/blobs/__init__.py
@@ -196,8 +196,11 @@ class BlobManager(BlobsSynchronizer):
check_http_status(response.code)
defer.returnValue((yield response.json()))
- def local_list(self, namespace='', sync_status=None):
- return self.local.list(namespace, sync_status)
+ def local_list(self, namespace=''):
+ return self.local.list(namespace)
+
+ def local_list_status(self, status, namespace=''):
+ return self.local.list_status(status, namespace)
def put(self, doc, size, namespace=''):
"""
@@ -222,6 +225,8 @@ class BlobManager(BlobsSynchronizer):
# TODO this is a tee really, but ok... could do db and upload
# concurrently. not sure if we'd gain something.
yield self.local.put(doc.blob_id, fd, size=size, namespace=namespace)
+ yield self.local.update_sync_status(
+ doc.blob_id, SyncStatus.PENDING_UPLOAD)
# In fact, some kind of pipe is needed here, where each write on db
# handle gets forwarded into a write on the connection handle
fd = yield self.local.get(doc.blob_id, namespace=namespace)