Skip to content

Commit 7df12fd

Browse files
authored
Add a check in cache.erase() to never attempt it in FROZEN_CACHE mode. (#25259)
If external logic is correct, then this exception should never be thrown. (I considered no-opping this call in FROZEN_CACHE mode, but I think that is not a good idea. Better to fix any callers to cache.erase() in FROZEN_CACHE mode directly)
1 parent 925c6c6 commit 7df12fd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/cache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def ensure():
8383

8484
def erase():
8585
ensure_setup()
86+
assert not config.FROZEN_CACHE, 'Cache cannot be erased when FROZEN_CACHE is set'
87+
8688
with lock('erase'):
8789
# Delete everything except the lockfile itself
8890
utils.delete_contents(cachedir, exclude=[os.path.basename(cachelock_name)])

0 commit comments

Comments
 (0)