diff options
| author | JP Dillingham <jp@dillingham.me> | 2025-01-27 09:05:22 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2025-01-27 09:05:22 -0600 |
| commit | b9ac9709e597eb565faad43dc25757873502b31f (patch) | |
| tree | cd98fe9c24c5e53a49759a76233ff43201c65686 | |
| parent | fa0b0a322a6d7be193400873e9fee4d9b91306d8 (diff) | |
| download | slskd-b9ac9709e597eb565faad43dc25757873502b31f.tar.gz | |
docs/indentation
| -rw-r--r-- | src/slskd/Search/SearchService.cs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/slskd/Search/SearchService.cs b/src/slskd/Search/SearchService.cs index c4c1003b..a4b59453 100644 --- a/src/slskd/Search/SearchService.cs +++ b/src/slskd/Search/SearchService.cs @@ -270,14 +270,19 @@ namespace slskd.Search try { + // initiate the search. this can throw at invocation if there's a problem with + // the client state (e.g. disconnected) or a problem with the search (e.g. no terms) var soulseekSearchTask = Client.SearchAsync( - query, - responseHandler: (response) => responses.Add(response), - scope, - token, - options, - cancellationToken: cancellationTokenSource.Token); - + query, + responseHandler: (response) => responses.Add(response), + scope, + token, + options, + cancellationToken: cancellationTokenSource.Token); + + // seach looks ok so far; let the rest of the logic run asynchronously + // on a background thread. this logic needs to clean up after itself and + // update the search record to accurately reflect the final state _ = Task.Run(async () => { try |
