aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-07-13 17:21:46 -0500
committerJP Dillingham <jp@dillingham.me>2025-07-13 17:21:46 -0500
commit2596869a91f6c9348f87bfbc6dce13eb73521a93 (patch)
treebdb6f283512562ed60b455f20082a9d5d74cc1a2
parentffb43e18f389a85a7dd4d4c3dee5faca40b90977 (diff)
downloadslskd-2596869a91f6c9348f87bfbc6dce13eb73521a93.tar.gz
docs
-rw-r--r--src/slskd/Search/SearchService.cs6
1 files changed, 4 insertions, 2 deletions
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;
}