reduce logging
This commit is contained in:
parent
90db51f9aa
commit
72c1fdacac
|
@ -18,7 +18,7 @@ final class Client(
|
|||
|
||||
private def withValidSituation[A](game: Game)(op: => Fu[A]): Fu[A] =
|
||||
if (game.toChess.situation playable true) op
|
||||
else fufail("[ai stockfish] invalid game situation: " + game.toChess.situation)
|
||||
else fufail("[ai stockfish] invalid position")
|
||||
|
||||
def play(game: Game, level: Int): Fu[PlayResult] = withValidSituation(game) {
|
||||
for {
|
||||
|
|
|
@ -41,7 +41,6 @@ final class Env(
|
|||
def receive = {
|
||||
case lila.hub.actorApi.ai.AutoAnalyse(gameId) =>
|
||||
val replyTo = sender
|
||||
play.api.Logger("analyse").info(s"auto analyse http://lichess.org/$gameId")
|
||||
analyser.getOrGenerate(gameId, "lichess", admin = true, auto = true) onComplete {
|
||||
case Failure(err) =>
|
||||
play.api.Logger("analyse").warn(s"auto analyse http://lichess.org/$gameId failure: $err")
|
||||
|
|
|
@ -20,9 +20,7 @@ final class CrosstableApi(coll: Coll) {
|
|||
|
||||
def apply(u1: String, u2: String): Fu[Option[Crosstable]] =
|
||||
coll.find(select(u1, u2)).one[Crosstable] orElse create(u1, u2) recover {
|
||||
case e: reactivemongo.core.commands.LastError =>
|
||||
play.api.Logger("crosstable").info(e.getMessage)
|
||||
none
|
||||
case e: reactivemongo.core.commands.LastError if e.getMessage.contains("duplicate key error") => none
|
||||
}
|
||||
|
||||
def add(game: Game): Funit = game.userIds.distinct.sorted match {
|
||||
|
|
|
@ -147,7 +147,7 @@ final class Env(
|
|||
{
|
||||
import scala.concurrent.duration._
|
||||
|
||||
scheduler.future(0.33 hour, "game: finish by clock") {
|
||||
scheduler.future(0.23 hour, "game: finish by clock") {
|
||||
titivate.finishByClock
|
||||
}
|
||||
|
||||
|
|
|
@ -21,13 +21,13 @@ private[round] final class Titivate(
|
|||
|
||||
def finishByClock: Funit =
|
||||
$primitive(Query.finishByClock, "_id", max = 5000.some)(_.asOpt[String]) addEffect { ids =>
|
||||
logwarn("[titivate] Finish %d games by clock" format ids.size)
|
||||
loginfo("[titivate] Finish %d games by clock" format ids.size)
|
||||
scheduler.throttle(100.millis)(ids) { id => roundMap ! Tell(id, Outoftime) }
|
||||
} void
|
||||
|
||||
def finishAbandoned: Funit =
|
||||
$primitive(Query.abandoned, "_id", max = 5000.some)(_.asOpt[String]) addEffect { ids =>
|
||||
logwarn("[titivate] Finish %d abandoned games" format ids.size)
|
||||
loginfo("[titivate] Finish %d abandoned games" format ids.size)
|
||||
scheduler.throttle(100.millis)(ids) { id => roundMap ! Tell(id, Abandon) }
|
||||
} void
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue