From 693636c94221e6d8778e4532b9a088f662011737 Mon Sep 17 00:00:00 2001 From: dcog989 Date: Thu, 14 Aug 2025 13:06:39 +0100 Subject: [PATCH] Clean orphan files, temp fix Clean orphan SQLite files on start-up that are being created by BrowserBookmark plugin. This is a temporary solution to prevent users' cache accumulating very large numbers of files / MB. Will be addressed properly with new version of plugin (complete rewrite for Flow Launcher V2). --- .../Main.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs index 33d7725f131..07ce510fb3e 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs @@ -36,6 +36,26 @@ public void Init(PluginInitContext context) _faviconCacheDir = Path.Combine( context.CurrentPluginMetadata.PluginCacheDirectoryPath, "FaviconCache"); + + try + { + if (Directory.Exists(_faviconCacheDir)) + { + var files = Directory.GetFiles(_faviconCacheDir); + foreach (var file in files) + { + var extension = Path.GetExtension(file); + if (extension is ".db-shm" or ".db-wal" or ".sqlite-shm" or ".sqlite-wal") + { + File.Delete(file); + } + } + } + } + catch (Exception e) + { + Context.API.LogException(ClassName, "Failed to clean up orphaned cache files.", e); + } LoadBookmarksIfEnabled(); }