From cd4fe3d0a19799ec9a4d61fdd67708a5017d6f07 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 15 Dec 2021 09:02:49 -0600 Subject: use CollectGarbage to collect garbage --- src/slskd/Search/SearchService.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/slskd/Search') diff --git a/src/slskd/Search/SearchService.cs b/src/slskd/Search/SearchService.cs index e529f738..b934e86b 100644 --- a/src/slskd/Search/SearchService.cs +++ b/src/slskd/Search/SearchService.cs @@ -45,16 +45,19 @@ namespace slskd.Search /// /// /// + /// /// The database context to use. /// The logger. public SearchService( IOptionsMonitor optionsMonitor, ISoulseekClient soulseekClient, + IApplication application, IDbContextFactory contextFactory, ILogger log) { OptionsMonitor = optionsMonitor; Client = soulseekClient; + Application = application; ContextFactory = contextFactory; Log = log; } @@ -63,6 +66,7 @@ namespace slskd.Search = new ConcurrentDictionary(); private IOptionsMonitor OptionsMonitor { get; } + private IApplication Application { get; } private ISoulseekClient Client { get; } private IDbContextFactory ContextFactory { get; } private ILogger Log { get; set; } @@ -130,6 +134,7 @@ namespace slskd.Search finally { CancellationTokens.TryRemove(id, out _); + Application.CollectGarbage(); } } -- cgit v1.2.3