mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +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", () => {
|
app.on("ready", () => {
|
||||||
if (config.get("options.autoResetAppCache")) {
|
if (config.get("options.autoResetAppCache")) {
|
||||||
// Clear cache
|
// Clear cache after 20s
|
||||||
electron.session.defaultSession.clearCache();
|
const clearCacheTimeout = setTimeout(() => {
|
||||||
|
if (is.dev()) {
|
||||||
|
console.log("Clearing app cache.");
|
||||||
|
}
|
||||||
|
electron.session.defaultSession.clearCache();
|
||||||
|
clearTimeout(clearCacheTimeout);
|
||||||
|
}, 20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
mainWindow = createMainWindow();
|
mainWindow = createMainWindow();
|
||||||
|
|||||||
Reference in New Issue
Block a user