Skip to content

Commit 70973b2

Browse files
committed
Clear cache after 20s if option is enabled
1 parent 5842a6d commit 70973b2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

index.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,14 @@ app.on("activate", () => {
209209

210210
app.on("ready", () => {
211211
if (config.get("options.autoResetAppCache")) {
212-
// Clear cache
213-
electron.session.defaultSession.clearCache();
212+
// Clear cache after 20s
213+
const clearCacheTimeout = setTimeout(() => {
214+
if (is.dev()) {
215+
console.log("Clearing app cache.");
216+
}
217+
electron.session.defaultSession.clearCache();
218+
clearTimeout(clearCacheTimeout);
219+
}, 20000);
214220
}
215221

216222
mainWindow = createMainWindow();

0 commit comments

Comments
 (0)