Skip to content

Commit

Permalink
cache: Add hash name check in cache client
Browse files Browse the repository at this point in the history
  • Loading branch information
octonawish-akcodes authored and spbnick committed Aug 24, 2023
1 parent 84f8a33 commit 084a45a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kcidb/cache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def store(self, url):
url: The URL to try to cache.
"""
object_name = self._format_object_name(url)

# Cache every 4096th URL only for the trial period
if not object_name.endswith("000"):
return

blob = self.client.bucket(self.bucket_name).blob(object_name)

if blob.exists():
Expand Down

0 comments on commit 084a45a

Please sign in to comment.