Skip to content

Commit 4b41578

Browse files
authored
Merge pull request #3902 from dcog989/Clean-orphan-files,-temp-fix
Clean orphan files, temp fix
2 parents f244812 + 693636c commit 4b41578

File tree

1 file changed

+20
-0
lines changed
  • Plugins/Flow.Launcher.Plugin.BrowserBookmark

1 file changed

+20
-0
lines changed

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@ public void Init(PluginInitContext context)
3636
_faviconCacheDir = Path.Combine(
3737
context.CurrentPluginMetadata.PluginCacheDirectoryPath,
3838
"FaviconCache");
39+
40+
try
41+
{
42+
if (Directory.Exists(_faviconCacheDir))
43+
{
44+
var files = Directory.GetFiles(_faviconCacheDir);
45+
foreach (var file in files)
46+
{
47+
var extension = Path.GetExtension(file);
48+
if (extension is ".db-shm" or ".db-wal" or ".sqlite-shm" or ".sqlite-wal")
49+
{
50+
File.Delete(file);
51+
}
52+
}
53+
}
54+
}
55+
catch (Exception e)
56+
{
57+
Context.API.LogException(ClassName, "Failed to clean up orphaned cache files.", e);
58+
}
3959

4060
LoadBookmarksIfEnabled();
4161
}

0 commit comments

Comments
 (0)