File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,10 @@ enum Constants {
13
13
static let cloudName = Secrets . cloudinaryCloudName
14
14
static let uploadPresetName = Secrets . cloudinaryUploadPresetName
15
15
}
16
+ enum Http {
17
+ static let requestWaitsForConnectivity = true
18
+ static let requestTimeoutSeconds : TimeInterval = 30
19
+ static let requestRetryDelaySeconds = 5
20
+ static let requestRetryLimit = 3
21
+ }
16
22
}
Original file line number Diff line number Diff line change @@ -28,11 +28,12 @@ final class AlamofireApi: Api {
28
28
self . logger = logger
29
29
30
30
let sessionConfig = URLSessionConfiguration . af. default
31
- sessionConfig. timeoutIntervalForRequest = 30
32
- sessionConfig. waitsForConnectivity = true
31
+ sessionConfig. timeoutIntervalForRequest = Constants . Http . requestTimeoutSeconds
32
+ sessionConfig. waitsForConnectivity = Constants . Http . requestWaitsForConnectivity
33
33
34
34
self . session = Session ( configuration: sessionConfig,
35
- interceptor: RetryingRequestInterceptor ( retryDelaySecs: 5 , maxRetries: 3 ) )
35
+ interceptor: RetryingRequestInterceptor ( retryDelaySecs: Constants . Http. requestRetryDelaySeconds,
36
+ maxRetries: Constants . Http. requestRetryLimit) )
36
37
37
38
}
38
39
You can’t perform that action at this time.
0 commit comments