diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-02-17 21:45:15 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-02-17 21:45:15 -0600 |
| commit | 1fd765471018c283761eb32c33ce229b2aaa86b5 (patch) | |
| tree | 622238ef9da550528ee2306deb7df03bd592df93 /src | |
| parent | 9361ecce8e36cd59fcb923f54144757e26bf2708 (diff) | |
| download | slskd-1fd765471018c283761eb32c33ce229b2aaa86b5.tar.gz | |
flatten params
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Common/Retry.cs | 16 |
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 ??= (_, _) => { }; |
