Skip to content

Commit d0dd976

Browse files
committed
feat: Automatic clock skew adjustment
1 parent eed7acf commit d0dd976

File tree

7 files changed

+3
-44
lines changed

7 files changed

+3
-44
lines changed

Package.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ let package = Package(
128128
),
129129
.target(
130130
name: "SmithyRetries",
131-
dependencies: [
132-
"SmithyRetriesAPI",
133-
.product(name: "AwsCommonRuntimeKit", package: "aws-crt-swift"),
134-
]
131+
dependencies: ["SmithyRetriesAPI"]
135132
),
136133
.target(
137134
name: "SmithyReadWrite",

Sources/ClientRuntime/Orchestrator/Orchestrator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public struct Orchestrator<
262262
do {
263263
_ = try context.getOutput()
264264
await strategy.recordSuccess(token: token)
265-
} catch let error {
265+
} catch {
266266
// If we can't get errorInfo, we definitely can't retry
267267
guard let errorInfo = retryErrorInfoProvider(error) else { return }
268268

Sources/SmithyRetries/ExponentialBackOffJitterType.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,10 @@
44
//
55
// SPDX-License-Identifier: Apache-2.0
66
//
7-
import AwsCommonRuntimeKit
87

98
public enum ExponentialBackOffJitterType: Sendable {
109
case `default`
1110
case none
1211
case full
1312
case decorrelated
1413
}
15-
16-
extension ExponentialBackOffJitterType {
17-
18-
func toCRTType() -> AwsCommonRuntimeKit.ExponentialBackoffJitterMode {
19-
switch self {
20-
case .default: return .default
21-
case .none: return .none
22-
case .full: return .full
23-
case .decorrelated: return .decorrelated
24-
}
25-
}
26-
}

Sources/SmithyRetries/RetryErrorType+CRT.swift

Lines changed: 0 additions & 21 deletions
This file was deleted.

Sources/SmithyRetriesAPI/RetryBackoffStrategy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
import Foundation
8+
import struct Foundation.TimeInterval
99

1010
public protocol RetryBackoffStrategy: Sendable {
1111
/// Returns a Duration that a caller performing retries should use for delaying between retries. In a green-threads context, this would be

Sources/SmithyRetriesAPI/RetryErrorInfoProvider.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
import Foundation
9-
108
/// A type that can triage errors for determining how & if to retry the error.
119
///
1210
/// Based on the error's content & properties, the retry error info provider will determine the general retry type of this error

Sources/SmithyRetriesAPI/RetryStrategy.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
import Foundation
9-
108
public protocol RetryStrategy {
119
associatedtype Token: RetryToken
1210

0 commit comments

Comments
 (0)