aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-02-18 18:54:53 -0600
committerJP Dillingham <jp@dillingham.me>2026-03-15 11:11:47 -0500
commit41032280e1fe34aa09707b3d3d116e11b794f727 (patch)
treee37925c556e7dfbacb24ca831687f7fe1558413a /src
parent6d8d4637621f933a63326d2fe0a69a6b71e6bdb1 (diff)
downloadslskd-41032280e1fe34aa09707b3d3d116e11b794f727.tar.gz
specify baseDelay
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/ConnectionWatchdog.cs1
-rw-r--r--src/slskd/Integrations/FTP/FTPService.cs1
-rw-r--r--src/slskd/Integrations/Pushbullet/PushbulletService.cs1
-rw-r--r--src/slskd/Integrations/Webhooks/WebhookService.cs1
-rw-r--r--src/slskd/Relay/RelayClient.cs7
5 files changed, 9 insertions, 2 deletions
diff --git a/src/slskd/Core/ConnectionWatchdog.cs b/src/slskd/Core/ConnectionWatchdog.cs
index d2f7caa8..1cf1779f 100644
--- a/src/slskd/Core/ConnectionWatchdog.cs
+++ b/src/slskd/Core/ConnectionWatchdog.cs
@@ -264,6 +264,7 @@ namespace slskd
{
var (delay, jitter) = Compute.ExponentialBackoffDelay(
iteration: attempts,
+ baseDelayInMilliseconds: 1000,
maxDelayInMilliseconds: ReconnectMaxDelayMilliseconds);
var approximateDelay = (int)Math.Ceiling((double)(delay + jitter) / 1000);
diff --git a/src/slskd/Integrations/FTP/FTPService.cs b/src/slskd/Integrations/FTP/FTPService.cs
index cb2b3a3f..ebf34708 100644
--- a/src/slskd/Integrations/FTP/FTPService.cs
+++ b/src/slskd/Integrations/FTP/FTPService.cs
@@ -76,6 +76,7 @@ namespace slskd.Integrations.FTP
isRetryable: (attempts, ex) => true,
onFailure: (attempts, ex) => Log.LogInformation("Failed attempt #{Attempts} to upload {Filename} to FTP: {Message}", attempts, fileAndParentDirectory, ex.Message),
maxAttempts: FtpOptions.RetryAttempts,
+ baseDelayInMilliseconds: 1000,
maxDelayInMilliseconds: 30000);
}
catch (RetryException ex)
diff --git a/src/slskd/Integrations/Pushbullet/PushbulletService.cs b/src/slskd/Integrations/Pushbullet/PushbulletService.cs
index 29033381..4c9df98c 100644
--- a/src/slskd/Integrations/Pushbullet/PushbulletService.cs
+++ b/src/slskd/Integrations/Pushbullet/PushbulletService.cs
@@ -153,6 +153,7 @@ namespace slskd.Integrations.Pushbullet
isRetryable: (attempts, ex) => true,
onFailure: (attempts, ex) => Log.LogWarning("Failed attempt #{Attempts} to send Pushbullet notification {Title} {Body}: {Message}", attempts, title, body, ex.Message),
maxAttempts: PushbulletOptions.RetryAttempts,
+ baseDelayInMilliseconds: 1000,
maxDelayInMilliseconds: 30000);
Log.LogInformation("Sent Pushbullet notification {Title} {Body}", title, body);
diff --git a/src/slskd/Integrations/Webhooks/WebhookService.cs b/src/slskd/Integrations/Webhooks/WebhookService.cs
index 62739d7a..8a009623 100644
--- a/src/slskd/Integrations/Webhooks/WebhookService.cs
+++ b/src/slskd/Integrations/Webhooks/WebhookService.cs
@@ -125,6 +125,7 @@ public class WebhookService
}
},
maxAttempts: webhook.Value.Retry.Attempts,
+ baseDelayInMilliseconds: 1000,
maxDelayInMilliseconds: 30000);
sw.Stop();
diff --git a/src/slskd/Relay/RelayClient.cs b/src/slskd/Relay/RelayClient.cs
index ae34e344..3e1903fb 100644
--- a/src/slskd/Relay/RelayClient.cs
+++ b/src/slskd/Relay/RelayClient.cs
@@ -162,8 +162,9 @@ namespace slskd.Relay
Log.Warning("Failed attempt #{Attempts} to connect to relay controller: {Message}", attempts, ex.Message);
},
maxAttempts: int.MaxValue,
+ baseDelayInMilliseconds: 1000,
maxDelayInMilliseconds: 30000,
- StartCancellationTokenSource.Token);
+ cancellationToken: StartCancellationTokenSource.Token);
}
finally
{
@@ -482,6 +483,7 @@ namespace slskd.Relay
isRetryable: (_, _) => true,
onFailure: (_, ex) => Log.Error(ex, "Failed to handle file download notification for {Filename} ({Token})", filename, token),
maxAttempts: 3,
+ baseDelayInMilliseconds: 1000,
maxDelayInMilliseconds: 60000);
Log.Information("File {Filename} successfully downloaded to {Destination}", filename, destinationFile);
@@ -592,8 +594,9 @@ namespace slskd.Relay
isRetryable: (_, _) => true,
onFailure: (count, ex) => Log.Warning("Failed attempt #{Attempts} to obtain share upload token: {Message}", count, ex.Message),
maxAttempts: 3,
+ baseDelayInMilliseconds: 1000,
maxDelayInMilliseconds: 5000,
- cancellationToken);
+ cancellationToken: cancellationToken);
Log.Debug("Share upload token {Token}", token);