diff options
author | drebs <drebs@leap.se> | 2017-12-08 21:55:45 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2017-12-13 13:43:48 -0200 |
commit | 601eb94cabe9d7003bdda012338bf0a3edfd46cb (patch) | |
tree | b359a18636cc79fa101d5038dd7774c434adac80 /src | |
parent | ad1e3a4a4863006b3415e619138c3bae88da3941 (diff) |
[refactor] make get_blob_size() return a deferred
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/soledad/server/_blobs.py | 3 | ||||
-rw-r--r-- | src/leap/soledad/server/interfaces.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/leap/soledad/server/_blobs.py b/src/leap/soledad/server/_blobs.py index f9166ce0..21becbf3 100644 --- a/src/leap/soledad/server/_blobs.py +++ b/src/leap/soledad/server/_blobs.py @@ -151,7 +151,8 @@ class FilesystemBlobsBackend(object): def get_blob_size(self, user, blob_id, namespace=''): blob_path = self._get_path(user, blob_id, namespace) - return os.stat(blob_path).st_size + size = os.stat(blob_path).st_size + return defer.succeed(size) def count(self, user, namespace=''): base_path = self._get_path(user, namespace=namespace) diff --git a/src/leap/soledad/server/interfaces.py b/src/leap/soledad/server/interfaces.py index f9257c9b..a7caf917 100644 --- a/src/leap/soledad/server/interfaces.py +++ b/src/leap/soledad/server/interfaces.py @@ -85,8 +85,8 @@ class IBlobsBackend(Interface): :param namespace: An optional namespace for the blob. :type namespace: str - :return: The size of the blob. - :rtype: int + :return: A deferred that fires with the size of the blob. + :rtype: twisted.internet.defer.Deferred """ def count(user, namespace=''): |