diff options
| author | JP Dillingham <jp@dillingham.me> | 2025-01-20 20:42:45 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2025-01-20 20:42:45 -0600 |
| commit | 301890c323e2248a97c7340d403288d2e6cc4d35 (patch) | |
| tree | 86e25f9271fd74e2020804ad5a87b9a64255797c | |
| parent | 71d8c3d233458fde02d7b169380ad347aaf88342 (diff) | |
| download | slskd-301890c323e2248a97c7340d403288d2e6cc4d35.tar.gz | |
log when cleaning starts, save updated search
| -rw-r--r-- | src/slskd/Application.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 82429b5f..8453386b 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -307,6 +307,8 @@ namespace slskd { Log.Information("Application started"); + Log.Debug("Cleaning up any dangling records"); + // if the application shut down "uncleanly", transfers may need to be cleaned up. we deliberately don't allow these // records to be updated if the application has started to shut down so that we can do this cleanup and properly // disposition them as having failed due to an application shutdown, instead of some random exception thrown while @@ -346,13 +348,15 @@ namespace slskd foreach (var search in activeSearches) { - Log.Debug("Cleaning up dangling search {Query}", search.SearchText); + Log.Debug("Cleaning up dangling search {Query} started {StartedAt}", search.SearchText, search.StartedAt); search.Responses = []; search.ResponseCount = 0; search.FileCount = 0; search.LockedFileCount = 0; search.State = SearchStates.Completed | SearchStates.TimedOut; search.EndedAt = DateTime.UtcNow; + + Search.Update(search); } // save the ids of any downloads that were active, so we can re-enqueue them after we've connected and logged in. |
