Skip to content

Commit 634607f

Browse files
committed
cache improvements
1 parent 9acb77f commit 634607f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

aura/cache.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ def proxy_mirror(cls, *, src: Path, cache_id=None):
7777
cache_id = f"mirror_{cache_id}"
7878
cache_pth: Path = cls.get_location() / cache_id
7979

80+
if cache_pth.exists():
81+
logger.debug(f"Retrieving mirror file path {cache_id} from cache")
82+
return cache_pth
83+
8084
try:
8185
shutil.copyfile(src, cache_pth, follow_symlinks=True)
8286
return cache_pth
@@ -94,6 +98,10 @@ def proxy_mirror_json(cls, *, src: Path):
9498
cache_id = f"mirrorjson_{src.name}"
9599
cache_path = cls.get_location()/cache_id
96100

101+
if cache_path.exists():
102+
logger.debug(f"Retrieving package mirror JSON {cache_id} from cache")
103+
return cache_path
104+
97105
try:
98106
shutil.copyfile(src=src, dst=cache_path, follow_symlinks=True)
99107
return cache_path

0 commit comments

Comments
 (0)