aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-01-20 20:42:45 -0600
committerJP Dillingham <jp@dillingham.me>2025-01-20 20:42:45 -0600
commit301890c323e2248a97c7340d403288d2e6cc4d35 (patch)
tree86e25f9271fd74e2020804ad5a87b9a64255797c /src
parent71d8c3d233458fde02d7b169380ad347aaf88342 (diff)
downloadslskd-301890c323e2248a97c7340d403288d2e6cc4d35.tar.gz
log when cleaning starts, save updated search
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Application.cs6
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.