From 2b08ad65a0424c60b74072afe0a874a2b8a8588f Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 20 Mar 2025 16:21:15 +0800 Subject: [PATCH] Only clear pool for one connection --- .../ChromiumBookmarkLoader.cs | 5 +++-- .../FirefoxBookmarkLoader.cs | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs index 7aabc4190..8fb04d252 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs @@ -192,6 +192,9 @@ public abstract class ChromiumBookmarkLoader : IBookmarkLoader Log.Exception($"Failed to extract bookmark favicon: {bookmark.Url}", ex); } } + + // https://github.com/dotnet/efcore/issues/26580 + SqliteConnection.ClearPool(connection); } catch (Exception ex) { @@ -201,8 +204,6 @@ public abstract class ChromiumBookmarkLoader : IBookmarkLoader // Delete temporary file try { - // https://github.com/dotnet/efcore/issues/26580 - SqliteConnection.ClearAllPools(); File.Delete(tempDbPath); } catch (Exception ex) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs index 187b77224..1b0189215 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs @@ -83,11 +83,12 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader LoadFaviconsFromDb(faviconDbPath, bookmarks); } + // https://github.com/dotnet/efcore/issues/26580 + SqliteConnection.ClearPool(dbConnection); + // Delete temporary file try { - // https://github.com/dotnet/efcore/issues/26580 - SqliteConnection.ClearAllPools(); File.Delete(tempDbPath); } catch (Exception ex) @@ -165,13 +166,14 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader { Log.Exception($"Failed to extract Firefox favicon: {bookmark.Url}", ex); } + + // https://github.com/dotnet/efcore/issues/26580 + SqliteConnection.ClearPool(connection); } // Delete temporary file try { - // https://github.com/dotnet/efcore/issues/26580 - SqliteConnection.ClearAllPools(); File.Delete(tempDbPath); } catch (Exception ex)