Skip to content

Commit

Permalink
Embrace using threadDelay with negative arguments (#1300)
Browse files Browse the repository at this point in the history
input-output-hk/io-sim#129 has been [fixed in
`si-timers-1.4`](https://hackage.haskell.org/package/si-timers-1.5.0.0/changelog),
and we already require `>=1.5`.
  • Loading branch information
amesgen authored Nov 5, 2024
2 parents 4519035 + 33260b2 commit a94de8f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ realHeaderInFutureCheck skew systemTime =
now <- systemTimeCurrent systemTime
let ageNow = now `diffRelTime` onset
syntheticDelay = negate ageNow
when (0 < syntheticDelay) $ do -- note https://github.com/input-output-hk/io-sim/issues/129
threadDelay $ nominalDelay syntheticDelay -- TODO leap seconds?
threadDelay $ nominalDelay syntheticDelay -- TODO leap seconds?

pure $ do
when tooEarly $ throwError FarFutureHeaderException {
Expand Down

0 comments on commit a94de8f

Please sign in to comment.