mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-10-28 14:04:39 +08:00
scripts/clean_functional_cache: Remove also .stamp files
The cache cleanup script already successfully removes the assets that are unused since more than 6 months, but it forgot to delete the corresponding timestamp files, too. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20260814122643.312129-1-thuth@redhat.com> Signed-off-by: Thomas Huth <th.huth@posteo.eu>
This commit is contained in:
1 parent
e18d211818
commit
c1bb594fe4
1 file changed
+3
-1
@@ -28,8 +28,9 @@ for file in cache_dir.iterdir():
|
||||
if len(file.name) != 64:
|
||||
continue
|
||||
|
||||
stampfile = file.with_suffix(".stamp")
|
||||
try:
|
||||
timestamp = int(file.with_suffix(".stamp").read_text())
|
||||
timestamp = int(stampfile.read_text())
|
||||
except FileNotFoundError:
|
||||
# Assume it's an old file that was already in the cache before we
|
||||
# added the code for evicting stale assets. Use the release date
|
||||
@@ -43,3 +44,4 @@ for file in cache_dir.iterdir():
|
||||
print(f"Removing {cache_dir}/{file.name}.")
|
||||
file.chmod(stat.S_IWRITE)
|
||||
file.unlink()
|
||||
stampfile.unlink()
|
||||
Reference in new issue
Block a user