debug maintenance tasks on prod DB
This commit is contained in:
parent
f9f5567a5e
commit
f7b9fd2a31
|
@ -313,7 +313,7 @@ case class Game(
|
|||
|
||||
def olderThan(seconds: Int) = updatedAt.??(_ < DateTime.now - seconds.seconds)
|
||||
|
||||
def abandoned = updatedAt.fold(false) { u ⇒
|
||||
def abandoned = updatedAt ?? { u ⇒
|
||||
(status <= Status.Started) && (u <= Game.abandonedDate)
|
||||
}
|
||||
|
||||
|
|
|
@ -20,13 +20,17 @@ private[round] final class Titivate(
|
|||
|
||||
def finishByClock: Funit =
|
||||
$enumerate.bulk[Option[Game]]($query(Query.candidatesToAutofinish), 50) { games ⇒
|
||||
fuloginfo("[titivate] Finish %d games by clock" format games.flatten.size) >>-
|
||||
fuccess {
|
||||
println("[titivate] Finish %d games by clock" format games.flatten.size)
|
||||
(games.flatten foreach { game ⇒ roundMap ! Tell(game.id, Outoftime) })
|
||||
}
|
||||
}
|
||||
|
||||
def finishAbandoned: Funit =
|
||||
$enumerate.bulk[Option[Game]]($query(Query.abandoned), 50) { games ⇒
|
||||
fuloginfo("[titivate] Finish %d abandoned games" format games.flatten.size) >>-
|
||||
fuccess {
|
||||
println("[titivate] Finish %d abandoned games" format games.flatten.size)
|
||||
(games.flatten foreach meddler.finishAbandoned)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue