save game rematch id
This commit is contained in:
parent
04c1bd6d82
commit
8e56db2512
|
@ -117,6 +117,10 @@ class GameRepo(collection: MongoCollection)
|
|||
)
|
||||
}
|
||||
|
||||
def saveNext(game: DbGame, nextId: String): IO[Unit] = io {
|
||||
update(idSelector(game), $set("next" -> nextId))
|
||||
}
|
||||
|
||||
def initialFen(gameId: String): IO[Option[String]] = io {
|
||||
primitiveProjection[String](idSelector(gameId), "initialFen")
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ final class Rematcher(
|
|||
_ ← gameRepo insert nextGame
|
||||
nextId = nextGame.id
|
||||
_ ← gameRepo denormalizeStarted nextGame
|
||||
_ ← gameRepo.saveNext(pov.game, nextGame.id)
|
||||
_ ← timelinePush(nextGame)
|
||||
// messenges are not sent to the next game socket
|
||||
// as nobody is there to see them yet
|
||||
|
|
Loading…
Reference in a new issue