Skip to content

Commit 8cfdf03

Browse files
authored
Fix 5.7/5.8 build errors (#298)
# Motivation Currently, this repo fails to build on Swift 5.7 and 5.8 since we were using clock APIs that were only available on 5.9.
1 parent 6360ca0 commit 8cfdf03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Sources/AsyncAlgorithms/AsyncThrottleSequence.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ extension AsyncThrottleSequence: AsyncSequence {
8585
// ensure the rate of elements never exceeds the given interval
8686
let amount = interval - last.duration(to: clock.now)
8787
if amount > .zero {
88-
try? await clock.sleep(for: amount)
88+
try? await clock.sleep(until: clock.now.advanced(by: amount), tolerance: nil)
8989
}
9090
}
9191
// the last value is unable to have any subsequent

0 commit comments

Comments
 (0)