make http round actions recover from failures

This commit is contained in:
Thibault Duplessis 2013-05-18 14:42:50 -03:00
parent e95252f70c
commit 4c30c1a6e0

View file

@ -124,14 +124,16 @@ object Round extends LilaController with TheftPrevention {
protected def performAndRedirect(fullId: String, makeMessage: String Any) = Action {
Async {
perform(fullId, makeMessage) inject Redirect(routes.Round.player(fullId))
perform(fullId, makeMessage) recover {
case e: Exception logwarn("[round] perform " + e.getMessage)
} inject Redirect(routes.Round.player(fullId))
}
}
protected def perform(fullId: String, makeMessage: String Any): Funit = {
Env.round.roundMap ! Tell(
GameModel takeGameId fullId,
makeMessage(GameModel takePlayerId(fullId))
makeMessage(GameModel takePlayerId (fullId))
)
Env.round.roundMap ? Await(GameModel takeGameId fullId) void
}