aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-02-17 21:45:15 -0600
committerJP Dillingham <jp@dillingham.me>2026-02-17 21:45:15 -0600
commit1fd765471018c283761eb32c33ce229b2aaa86b5 (patch)
tree622238ef9da550528ee2306deb7df03bd592df93 /src
parent9361ecce8e36cd59fcb923f54144757e26bf2708 (diff)
downloadslskd-1fd765471018c283761eb32c33ce229b2aaa86b5.tar.gz
flatten params
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Common/Retry.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/slskd/Common/Retry.cs b/src/slskd/Common/Retry.cs
index 300c1c51..f57b59d8 100644
--- a/src/slskd/Common/Retry.cs
+++ b/src/slskd/Common/Retry.cs
@@ -37,7 +37,13 @@ namespace slskd
/// <param name="maxDelayInMilliseconds">The maximum delay in milliseconds.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
/// <returns>The execution context.</returns>
- public static async Task Do(Func<Task> task, Func<int, Exception, bool> isRetryable = null, Action<int, Exception> onFailure = null, int maxAttempts = 3, int maxDelayInMilliseconds = int.MaxValue, CancellationToken cancellationToken = default)
+ public static async Task Do(
+ Func<Task> task,
+ Func<int, Exception, bool> isRetryable = null,
+ Action<int, Exception> onFailure = null,
+ int maxAttempts = 3,
+ int maxDelayInMilliseconds = int.MaxValue,
+ CancellationToken cancellationToken = default)
{
await Do<object>(async () =>
{
@@ -57,7 +63,13 @@ namespace slskd
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
/// <typeparam name="T">The Type of the logic return value.</typeparam>
/// <returns>The execution context.</returns>
- public static async Task<T> Do<T>(Func<Task<T>> task, Func<int, Exception, bool> isRetryable = null, Action<int, Exception> onFailure = null, int maxAttempts = 3, int maxDelayInMilliseconds = int.MaxValue, CancellationToken cancellationToken = default)
+ public static async Task<T> Do<T>(
+ Func<Task<T>> task,
+ Func<int, Exception, bool> isRetryable = null,
+ Action<int, Exception> onFailure = null,
+ int maxAttempts = 3,
+ int maxDelayInMilliseconds = int.MaxValue,
+ CancellationToken cancellationToken = default)
{
isRetryable ??= (_, _) => true;
onFailure ??= (_, _) => { };