Skip to content

Commit

Permalink
Simplify log entry in example
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Chapuis authored and jchapuis committed Oct 10, 2024
1 parent 108c4a1 commit 45d9b10
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ final case class BookingEntityBehavior[F[_]: Logger: Clock](
booking.status match {
case Status.Accepted | Status.Pending =>
EitherT.liftF(
(Clock[F].realTimeInstant >>= (timestamp =>
Logger[F]
.info(show"Cancelling booking with ID ${booking.id} at ${timestamp.toString}")
)) >> entity.write(BookingCancelled)
Logger[F].info(show"Cancelling booking with ID ${booking.id}") >> entity.write(
BookingCancelled
)
)
case Status.Cancelled => EitherT.pure(())
case Status.Rejected => EitherT.leftT[F, Unit](BookingAlg.BookingWasRejected(booking.id))
Expand Down

0 comments on commit 45d9b10

Please sign in to comment.