aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Relay/RelayService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/slskd/Relay/RelayService.cs')
-rw-r--r--src/slskd/Relay/RelayService.cs10
1 files changed, 9 insertions, 1 deletions
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
/// <returns>The operation context.</returns>
public Task HandleShareUpload(string agentName, Guid id, IEnumerable<Share> 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 });