util/disk_cache: Fix cache marker refresh.

Refresh if older than a day, not less than a day old.

Fixes: 3f119a1fd8 ("util/disk_cache: Add marker on cache usage")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29728>
(cherry picked from commit 9b775d26c4)
This commit is contained in:
Bas Nieuwenhuizen 2024-06-14 13:33:13 +02:00 committed by Eric Engestrom
parent 10d38dd727
commit 46ae863f9e
2 changed files with 2 additions and 2 deletions

View file

@ -1434,7 +1434,7 @@
"description": "util/disk_cache: Fix cache marker refresh.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "3f119a1fd8deaa46c4342837d13096cd7873c8d2",
"notes": null

View file

@ -1077,7 +1077,7 @@ disk_cache_touch_cache_user_marker(char *path)
if (fd != -1) {
close(fd);
}
} else if (now - attr.st_mtime < 60 * 60 * 24 /* One day */) {
} else if (now - attr.st_mtime > 60 * 60 * 24 /* One day */) {
(void)utime(marker_path, NULL);
}
free(marker_path);