diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2022-07-17 10:43:01 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2022-07-17 10:43:01 -0500 |
| commit | 58626e1e8f954160fc86f4c15f437c6698bf49db (patch) | |
| tree | 7a220a49d14498c49f14aeda78265a4fe96b5c57 /src | |
| parent | f5bf3be24c2732ac01f0565f1ddd136fe919215e (diff) | |
| download | slskd-58626e1e8f954160fc86f4c15f437c6698bf49db.tar.gz | |
remove guard and note about errant updates
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Search/SearchService.cs | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/slskd/Search/SearchService.cs b/src/slskd/Search/SearchService.cs index 9b30f26c..12c75fb1 100644 --- a/src/slskd/Search/SearchService.cs +++ b/src/slskd/Search/SearchService.cs @@ -117,22 +117,16 @@ namespace slskd.Search }, responseReceived: (args) => rateLimiter.Invoke(() => { - // due to the rate limiter, this has the potential to be executed after the search is complete. - // ensure that doesn't happen. this causes the update to be dropped, but we broadcast again when - // the search is complete with the final stats, so it has no negative impact. - if (search.State.HasFlag(SearchStates.InProgress)) - { - // note: this is rate limited, but has the potential to update - // the database every 250ms (or whatever the interval is set to) - // for the duration of the search. any issues with disk/io or performance - // while searches are running should investigate this as a cause - search.ResponseCount = args.Search.ResponseCount; - search.FileCount = args.Search.FileCount; - search.LockedFileCount = args.Search.LockedFileCount; - - SearchHub.BroadcastUpdateAsync(search); - _ = UpdateAndSaveChangesAsync(search); - } + // note: this is rate limited, but has the potential to update + // the database every 250ms (or whatever the interval is set to) + // for the duration of the search. any issues with disk i/o or performance + // while searches are running should investigate this as a cause + search.ResponseCount = args.Search.ResponseCount; + search.FileCount = args.Search.FileCount; + search.LockedFileCount = args.Search.LockedFileCount; + + SearchHub.BroadcastUpdateAsync(search); + _ = UpdateAndSaveChangesAsync(search); })); var soulseekSearchTask = Client.SearchAsync( |
