Skip to content

Commit

Permalink
Add empty method to cache client
Browse files Browse the repository at this point in the history
  • Loading branch information
octonawish-akcodes authored and spbnick committed Jul 27, 2023
1 parent 33108fb commit 3d34045
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kcidb/cache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,9 @@ def fetch(self, url):
if blob.exists():
return blob.download_as_bytes()
return None

def empty(self):
"""Empty the cache (remove all contents)."""
bucket = self.client.bucket(self.bucket_name)
for blob in bucket.list_blobs():
blob.delete()

0 comments on commit 3d34045

Please sign in to comment.