Skip to content

Commit

Permalink
push broadcast games immediately when none has any move played
Browse files Browse the repository at this point in the history
ignoring the delay
  • Loading branch information
ornicar committed Nov 21, 2024
1 parent fe560b3 commit d73217b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/relay/src/main/RelayPush.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ final class RelayPush(
parsed.map(_.map(g => Success(g.tags, g.root.mainline.size)))
val andSyncTargets = response.exists(_.isRight)

rt.round.sync.nonEmptyDelay match
case None => push(rt, games, andSyncTargets).inject(response)
case Some(delay) =>
after(delay.value.seconds)(push(rt, games, andSyncTargets))
fuccess(response)
rt.round.sync.nonEmptyDelay
.ifTrue(games.exists(_.root.children.nonEmpty))
.match
case None => push(rt, games, andSyncTargets).inject(response)
case Some(delay) =>
after(delay.value.seconds)(push(rt, games, andSyncTargets))
fuccess(response)

private def push(rt: RelayRound.WithTour, rawGames: Vector[RelayGame], andSyncTargets: Boolean) =
workQueue(rt.round.id):
Expand Down

0 comments on commit d73217b

Please sign in to comment.