fix: improve code readability in GameRecordRepository and GameRedisPublisher
Build & Test (NowChessSystems) TeamCity build failed

This commit is contained in:
2026-05-16 13:22:40 +02:00
parent 6448bec3f8
commit fcd7c80169
2 changed files with 7 additions and 5 deletions
@@ -26,7 +26,8 @@ class GameRedisPublisher(
) extends Observer: ) extends Observer:
def emitInitialWriteback(): Unit = def emitInitialWriteback(): Unit =
try registry.get(gameId).foreach { entry => try
registry.get(gameId).foreach { entry =>
val dto = GameDtoMapper.toGameStateDto(entry, ioClient) val dto = GameDtoMapper.toGameStateDto(entry, ioClient)
writebackEmit(objectMapper.writeValueAsString(buildWriteback(entry, dto))) writebackEmit(objectMapper.writeValueAsString(buildWriteback(entry, dto)))
} }
@@ -42,7 +42,8 @@ class GameRecordRepository:
.asScala .asScala
.toList .toList
.filter { g => .filter { g =>
val remaining = if g.clockActiveColor == "white" then g.whiteRemainingMs.longValue else g.blackRemainingMs.longValue val remaining =
if g.clockActiveColor == "white" then g.whiteRemainingMs.longValue else g.blackRemainingMs.longValue
g.clockLastTickAt.longValue + remaining < nowMs g.clockLastTickAt.longValue + remaining < nowMs
} }