summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-10-31 06:21:31 -0300
committerVictor Shyba <victor1984@riseup.net>2017-10-31 06:21:31 -0300
commitf1c010fc4119d6348d0bd823e4a9f6da310149bd (patch)
treece23cd1362c886775c5f17199042da8d43dc675f /src
parentc8234da89b198064f1d1f14bec6811c0883e705c (diff)
[style] wrong/missing docs/comments (code review)
Diffstat (limited to 'src')
-rw-r--r--src/leap/soledad/client/_db/blobs/sql.py10
-rw-r--r--src/leap/soledad/client/_db/blobs/sync.py7
2 files changed, 7 insertions, 10 deletions
diff --git a/src/leap/soledad/client/_db/blobs/sql.py b/src/leap/soledad/client/_db/blobs/sql.py
index e81580a7..4afc13ac 100644
--- a/src/leap/soledad/client/_db/blobs/sql.py
+++ b/src/leap/soledad/client/_db/blobs/sql.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# _blobs.py
+# sql.py
# Copyright (C) 2017 LEAP
#
# This program is free software: you can redistribute it and/or modify
@@ -78,14 +78,6 @@ class SQLiteBlobBackend(object):
irow = yield self.dbpool.insertAndGetLastRowid(insert, values)
yield self.dbpool.write_blob('blobs', 'payload', irow, blob_fd)
logger.info("Finished saving blob in local database.")
- """
- # set as synced if it was pending
- previous_state = yield self.get_sync_status(blob_id)
- unavailable = SyncStatus.UNAVAILABLE_STATUSES
- if previous_state and previous_state[0] in unavailable:
- status = SyncStatus.SYNCED
- yield self.update_sync_status(blob_id, status, namespace)
- """
@defer.inlineCallbacks
def get(self, blob_id, namespace=''):
diff --git a/src/leap/soledad/client/_db/blobs/sync.py b/src/leap/soledad/client/_db/blobs/sync.py
index d47033b2..838b87e5 100644
--- a/src/leap/soledad/client/_db/blobs/sync.py
+++ b/src/leap/soledad/client/_db/blobs/sync.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# _blobs.py
+# sync.py
# Copyright (C) 2017 LEAP
#
# This program is free software: you can redistribute it and/or modify
@@ -37,6 +37,11 @@ MAX_WAIT = 60 # In seconds. Max time between retries
@defer.inlineCallbacks
def with_retry(func, *args, **kwargs):
+ """
+ Run func repeatedly until success, as long as the exception raised is
+ a "retriable error". If an exception of another kind is raised by func,
+ the retrying stops and that exception is propagated up the stack.
+ """
retry_wait = 1
retriable_errors = (error.ConnectError, error.ConnectionClosed,
RetriableTransferError,)