Skip to content

Commit

Permalink
main: clean cache by atime
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujia Qiao committed Sep 8, 2021
1 parent 60a458a commit 7147247
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/api/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7147247

Please sign in to comment.