Skip to content

Commit

Permalink
Fix 5.7/5.8 build errors (#298)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
FranzBusch authored Sep 27, 2023
1 parent 6360ca0 commit 8cfdf03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/AsyncAlgorithms/AsyncThrottleSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ extension AsyncThrottleSequence: AsyncSequence {
// ensure the rate of elements never exceeds the given interval
let amount = interval - last.duration(to: clock.now)
if amount > .zero {
try? await clock.sleep(for: amount)
try? await clock.sleep(until: clock.now.advanced(by: amount), tolerance: nil)
}
}
// the last value is unable to have any subsequent
Expand Down

0 comments on commit 8cfdf03

Please sign in to comment.