From f734a9a8cce50e4ed638274758dd1ff0f99e14e7 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 7 Jan 2023 16:14:15 -0600 Subject: polish logging --- src/slskd/Relay/RelayService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/slskd/Relay/RelayService.cs') diff --git a/src/slskd/Relay/RelayService.cs b/src/slskd/Relay/RelayService.cs index 47879b19..1dda50c2 100644 --- a/src/slskd/Relay/RelayService.cs +++ b/src/slskd/Relay/RelayService.cs @@ -456,7 +456,7 @@ namespace slskd.Relay var key = new WaitKey(nameof(GetFileInfoAsync), agentName, id); var wait = Waiter.Wait<(bool Exists, long Length)>(key, timeout); - Log.Information("Created wait {Key}", key); + Log.Debug("Created wait {Key}", key); try { @@ -624,6 +624,8 @@ namespace slskd.Relay /// The operation context. public Task HandleShareUpload(string agentName, Guid id, IEnumerable shares, string filename) { + Log.Information("Loading shares from agent {Agent}", agentName); + using var repository = ShareRepositoryFactory.CreateFromFile(filename); if (!repository.TryValidate(out var problems)) @@ -637,6 +639,8 @@ namespace slskd.Relay Shares.AddOrUpdateHost(new Host(agentName, shares)); + Log.Information("Shares from agent {Agent} ready.", agentName); + return Task.CompletedTask; } @@ -694,8 +698,12 @@ namespace slskd.Relay if (TryGetAgentRegistration(connectionId, out var found)) { + Log.Information("Unloading shares for agent {Agent}", found.Agent.Name); + Shares.TryRemoveHost(found.Agent.Name); removed = RegisteredAgentDictionary.TryRemove(found.Agent.Name, out record); + + Log.Information("Shares for agent {Agent} unloaded", found.Agent.Name); } State.SetValue(state => state with { Agents = RegisteredAgents }); -- cgit v1.2.3