Przeglądaj źródła

Add @Sendable to RetryPolicy.retry's completion (#3994)

### Goals :soccer:
<!-- List the high-level objectives of this pull request. -->
<!-- Include any relevant context. -->
Adding on to #3906, this PR adds `@Sendable` to the completion handler
of RetryPolicy's retry function
Colin Willson 1 tydzień temu
rodzic
commit
bfdb63464b
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      Source/Features/RetryPolicy.swift

+ 1 - 1
Source/Features/RetryPolicy.swift

@@ -308,7 +308,7 @@ open class RetryPolicy: @unchecked Sendable, RequestInterceptor {
     open func retry(_ request: Request,
                     for session: Session,
                     dueTo error: any Error,
-                    completion: @escaping (RetryResult) -> Void) {
+                    completion: @escaping @Sendable (RetryResult) -> Void) {
         if request.retryCount < retryLimit, shouldRetry(request: request, dueTo: error) {
             completion(.retryWithDelay(pow(Double(exponentialBackoffBase), Double(request.retryCount)) * exponentialBackoffScale))
         } else {