From 2596869a91f6c9348f87bfbc6dce13eb73521a93 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 13 Jul 2025 17:21:46 -0500 Subject: docs --- src/slskd/Search/SearchService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Search/SearchService.cs b/src/slskd/Search/SearchService.cs index d542b65a..186267d0 100644 --- a/src/slskd/Search/SearchService.cs +++ b/src/slskd/Search/SearchService.cs @@ -334,10 +334,12 @@ namespace slskd.Search } } - // todo: remove this once we're sure the problem is fixed + // it shouldn't be possible for this to happen, as the StateChanged callback is called before the + // SearchAsync() method returns, and we will have already updated the record at that time. if for + // some extremely odd reason that doesn't happen, make sure the record is persisted the final time + // with the Completed flag set to avoid it getting "stuck" if (!search.State.HasFlag(SearchStates.Completed)) { - Log.Warning("Gotcha! Search for '{Search}' concluded without the Completed flag. Time is now {Timestamp}. States: {States}", query.SearchText, DateTime.UtcNow, stateTransitions); search.State |= SearchStates.Completed; } -- cgit v1.2.3