From 92bb5087ccefe1a2457c13e7872a564897bc63c0 Mon Sep 17 00:00:00 2001 From: Casey Ransom Date: Fri, 5 Apr 2024 11:30:01 -0400 Subject: [PATCH] fixup! Add manifest caching shortcut --- src/zinc/storages/aws.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/zinc/storages/aws.py b/src/zinc/storages/aws.py index 16944e2..68a4dcc 100644 --- a/src/zinc/storages/aws.py +++ b/src/zinc/storages/aws.py @@ -11,6 +11,7 @@ from . import StorageBackend log = logging.getLogger(__name__) +logging.basicConfig(level = logging.DEBUG ) class S3StorageBackend(StorageBackend): @@ -67,8 +68,10 @@ def get(self, subpath): t = TemporaryFile(mode='w+b') cache_location = os.environ.get('ZINC_CACHE') if cache_location and exists(os.path.join(cache_location, keyname)): + log.debug(f"GET Cache hit: {subpath} ({keyname})") t = open(os.path.join(cache_location,keyname), 'rb') else: + log.debug(f"GET Cache miss: {subpath} ({keyname})") self._bucket.download_fileobj(keyname, t) if t.tell() == 0: return None