We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f32aca6 commit 03b623dCopy full SHA for 03b623d
Sources/AsyncAlgorithms/Retry/Retry.swift
@@ -14,7 +14,7 @@ public func retry<Result, ErrorType, ClockType>(
14
operation: () async throws(ErrorType) -> sending Result,
15
strategy: (_ attempt: Int, ErrorType) -> RetryStrategy<ClockType.Instant.Duration> = { _, _ in .backoff(.zero) }
16
) async throws -> Result where ClockType: Clock, ErrorType: Error {
17
- precondition(maxAttempts >= 0, "Must have at least one attempt")
+ precondition(maxAttempts > 0, "Must have at least one attempt")
18
for attempt in 0..<maxAttempts - 1 {
19
do {
20
return try await operation()
0 commit comments