Skip to content

Commit

Permalink
Fixed formatting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtar committed Jan 24, 2024
1 parent 752015d commit 9353df1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ object Damper {
case State.Idle(acquired) =>
(State.Idle(acquired = acquired - 1), ().pure[F])
case state: State.Busy =>
if (filter) {
if (filter) {
val entries = state.entries.filter(_ != entry)
if (state.entries.sizeCompare(entries) == 0) {
wakeUp(state)
wakeUp(state)
} else {
(state.copy(entries = entries), ().pure[F])
(state.copy(entries = entries), ().pure[F])
}
} else {
wakeUp(state)
wakeUp(state)
}
}
.flatten
Expand All @@ -281,7 +281,7 @@ object Damper {
ref
.modify {
case state: State.Idle =>
val acquired = state.acquired
val acquired = state.acquired
val delay = delayOf1(acquired)
if (delay.length == 0) {
// zero delay is expected
Expand All @@ -302,7 +302,7 @@ object Damper {
)
}
case state: State.Busy =>
// we already have some delays in progress,
// we already have some delays in progress,
// so we add a new one to the waiting queue
(
state.copy(entries = state.entries.enqueue(entry)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package com.evolutiongaming.kafka.journal
import cats.effect.{FiberIO, IO, Ref}
import cats.effect.unsafe.implicits.global
import cats.syntax.all._

import org.scalatest.funsuite.AsyncFunSuite
import org.scalatest.matchers.should.Matchers
import com.evolutiongaming.kafka.journal.IOSuite._

import scala.concurrent.TimeoutException
import scala.concurrent.duration._
import org.scalatest.compatible.Assertion


class DamperTest extends AsyncFunSuite with Matchers {

Expand Down

0 comments on commit 9353df1

Please sign in to comment.