feat: local tour WORKS bots play
Build & Test (NowChessSystems) TeamCity build failed

This commit is contained in:
Lala, Shahd
2026-06-04 18:13:34 +00:00
parent a46cff5342
commit 3b42aea416
6 changed files with 406 additions and 84 deletions
@@ -49,7 +49,8 @@ class GameResultStreamListener:
case Success(_) => ()
private def pollLoop(): Unit =
while true do
var running = true
while running do
Try {
val messages = redis.stream(classOf[String]).xreadgroup(
groupName,
@@ -60,9 +61,16 @@ class GameResultStreamListener:
)
if messages != null then messages.forEach(msg => handleMessage(msg))
} match
case Failure(ex) if isInterrupted(ex) =>
Thread.currentThread().interrupt()
running = false
case Failure(ex) => log.warnf(ex, "Error in result poll loop")
case Success(_) => ()
private def isInterrupted(ex: Throwable): Boolean =
ex.isInstanceOf[InterruptedException] ||
(ex.getCause != null && ex.getCause.isInstanceOf[InterruptedException])
private def handleMessage(msg: StreamMessage[String, String, String]): Unit =
val json = msg.payload().get("data")
Try(objectMapper.readValue(json, classOf[GameWritebackEventDto])) match