diff --git a/swh/vault/cache.py b/swh/vault/cache.py index 5717d40f2de688b32cf6eac393aa97dc39860a59..bd88b9f6a268f2c5939e9fa9c6688eb9e36671e9 100644 --- a/swh/vault/cache.py +++ b/swh/vault/cache.py @@ -19,11 +19,11 @@ class VaultCache: def __init__(self, **objstorage): self.objstorage = get_objstorage(**objstorage) - def add(self, bundle_type, swhid: CoreSWHID, content): + def add(self, bundle_type, swhid: CoreSWHID, content) -> None: sid = self._get_internal_id(bundle_type, swhid) - return self.objstorage.add(content, sid) + self.objstorage.add(content, sid) - def get(self, bundle_type, swhid: CoreSWHID): + def get(self, bundle_type, swhid: CoreSWHID) -> bytes: sid = self._get_internal_id(bundle_type, swhid) return self.objstorage.get(hashutil.hash_to_bytes(sid)) @@ -31,7 +31,7 @@ class VaultCache: sid = self._get_internal_id(bundle_type, swhid) return self.objstorage.delete(hashutil.hash_to_bytes(sid)) - def is_cached(self, bundle_type, swhid: CoreSWHID): + def is_cached(self, bundle_type, swhid: CoreSWHID) -> bool: sid = self._get_internal_id(bundle_type, swhid) return hashutil.hash_to_bytes(sid) in self.objstorage