From 7147247111b17de163606afbc4e6f17a39c55dd4 Mon Sep 17 00:00:00 2001 From: Yujia Qiao Date: Wed, 8 Sep 2021 23:07:49 +0800 Subject: [PATCH] main: clean cache by atime --- src/main/api/cache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/api/cache.js b/src/main/api/cache.js index cc7cc2ac..a69be59b 100644 --- a/src/main/api/cache.js +++ b/src/main/api/cache.js @@ -73,7 +73,7 @@ class Cache { let diskUsage = stats.reduce((x, y)=> x + y.size, 0); if (diskUsage <= this.cacheLimit) return; - stats.sort((a, b)=> a.ctime < b.ctime); + stats.sort((a, b)=> a.atime < b.atime); for (const st of stats) { const size = st.size; diskUsage -= size;