fix(artifacts): catch FileNotFoundError and PermissionError during cache.cleanup()
Catch FileNotFoundError and PermissionError during cache.cleanup
@@ -908,17 +908,16 @@ class ArtifactsCache:
total_size: int = 0
for root, _, files in os.walk(self._cache_dir):
for file in files:
+ try:
path = os.path.join(root, file)
stat = os.stat(path)
if file.startswith(ArtifactsCache._TMP_PREFIX):
- try:
os.remove(path)
bytes_reclaimed += stat.st_size
+ continue
except OSError:
- pass
continue
-
paths[path] = stat
total_size += stat.st_size
