From f1c010fc4119d6348d0bd823e4a9f6da310149bd Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Tue, 31 Oct 2017 06:21:31 -0300 Subject: [style] wrong/missing docs/comments (code review) --- src/leap/soledad/client/_db/blobs/sql.py | 10 +--------- src/leap/soledad/client/_db/blobs/sync.py | 7 ++++++- 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,) -- cgit v1.2.3