add puzzle batch logging
This commit is contained in:
parent
76acfe2bfe
commit
891be29d38
|
@ -79,11 +79,15 @@ private[puzzle] final class Finisher(
|
|||
rating = formerUserRating,
|
||||
ratingDiff = userPerf.intRating - formerUserRating
|
||||
)
|
||||
bus.publish(Puzzle.UserResult(puzzle.id, user.id, result, formerUserRating -> userPerf.intRating), 'finishPuzzle)
|
||||
(api.round add a) >>
|
||||
UserRepo.setPerf(user.id, PerfType.Puzzle, userPerf) inject
|
||||
user.copy(perfs = user.perfs.copy(puzzle = userPerf))
|
||||
UserRepo.setPerf(user.id, PerfType.Puzzle, userPerf) >>-
|
||||
bus.publish(
|
||||
Puzzle.UserResult(puzzle.id, user.id, result, formerUserRating -> userPerf.intRating),
|
||||
'finishPuzzle
|
||||
) inject
|
||||
user.copy(perfs = user.perfs.copy(puzzle = userPerf))
|
||||
} recover lila.db.recoverDuplicateKey { _ =>
|
||||
logger.info(s"ratedUntrusted ${user.id} ${puzzle.id} duplicate round")
|
||||
user // has already been solved!
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,10 @@ private[puzzle] final class PuzzleBatch(
|
|||
_ <- data.solutions.lastOption ?? { lastSolution =>
|
||||
api.head.solved(user, lastSolution.id).void
|
||||
}
|
||||
} yield ()
|
||||
} yield for {
|
||||
first <- puzzles.headOption.flatten
|
||||
last <- puzzles.lastOption.flatten
|
||||
} logger.info(s"Batch solve ${user.id} ${puzzles.size} ${first.id}->${last.id}")
|
||||
|
||||
object select {
|
||||
|
||||
|
|
Loading…
Reference in a new issue