Skip to content

Commit

Permalink
Merge pull request #66 from avast/FixTimerPairCE3
Browse files Browse the repository at this point in the history
TimerPairImpl fix
  • Loading branch information
jendakol authored May 27, 2022
2 parents df680b1 + b4b1b63 commit 3b4b889
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import cats.effect.Sync
import cats.syntax.applicativeError._
import cats.syntax.flatMap._
import cats.syntax.functor._

import java.time.{Duration => JDuration}
import com.avast.metrics.scalaeffectapi.{Timer, TimerPair}

import java.time.{Duration => JDuration}
import scala.concurrent.duration.Duration

private class TimerPairImpl[F[_]: Sync](success: Timer[F], failure: Timer[F]) extends TimerPair[F] {
Expand All @@ -27,13 +26,13 @@ private class TimerPairImpl[F[_]: Sync](success: Timer[F], failure: Timer[F]) ex
}
}

override def update(duration: JDuration): F[Unit] = Sync[F].delay(success.update(duration))
override def update(duration: JDuration): F[Unit] = success.update(duration)

override def updateFailure(duration: JDuration): F[Unit] = Sync[F].delay(failure.update(duration))
override def updateFailure(duration: JDuration): F[Unit] = failure.update(duration)

override def update(duration: Duration): F[Unit] = Sync[F].delay(success.update(duration))
override def update(duration: Duration): F[Unit] = success.update(duration)

override def updateFailure(duration: Duration): F[Unit] = Sync[F].delay(failure.update(duration))
override def updateFailure(duration: Duration): F[Unit] = failure.update(duration)

override def time[T](action: F[T]): F[T] = {
for {
Expand Down

0 comments on commit 3b4b889

Please sign in to comment.