Преглед изворни кода

Moved retry API implementation out of extension to allow subclassing

Christian Noon пре 6 година
родитељ
комит
5ff0c8a557
1 измењених фајлова са 1 додато и 5 уклоњено
  1. 1 5
      Source/RetryPolicy.swift

+ 1 - 5
Source/RetryPolicy.swift

@@ -26,7 +26,7 @@ import Foundation
 
 /// A retry policy that retries requests using an exponential backoff for allowed HTTP methods and HTTP status codes
 /// as well as certain types of networking errors.
-open class RetryPolicy {
+open class RetryPolicy: RequestRetrier {
     /// The default retry limit for retry policies.
     public static let defaultRetryLimit: UInt = 2
 
@@ -309,11 +309,7 @@ open class RetryPolicy {
         self.retryableHTTPStatusCodes = retryableHTTPStatusCodes
         self.retryableURLErrorCodes = retryableURLErrorCodes
     }
-}
-
-// MARK: -
 
-extension RetryPolicy: RequestRetrier {
     open func retry(
         _ request: Request,
         for session: Session,