mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
Clear cache after 20s if option is enabled
This commit is contained in:
10
index.js
10
index.js
@ -209,8 +209,14 @@ app.on("activate", () => {
|
||||
|
||||
app.on("ready", () => {
|
||||
if (config.get("options.autoResetAppCache")) {
|
||||
// Clear cache
|
||||
electron.session.defaultSession.clearCache();
|
||||
// Clear cache after 20s
|
||||
const clearCacheTimeout = setTimeout(() => {
|
||||
if (is.dev()) {
|
||||
console.log("Clearing app cache.");
|
||||
}
|
||||
electron.session.defaultSession.clearCache();
|
||||
clearTimeout(clearCacheTimeout);
|
||||
}, 20000);
|
||||
}
|
||||
|
||||
mainWindow = createMainWindow();
|
||||
|
||||
Reference in New Issue
Block a user