raise to 40 server analysis per day, 200 per week

pull/9914/head
Thibault Duplessis 2021-10-02 20:32:48 +02:00
parent 681bbeb51b
commit d1201d7260
2 changed files with 9 additions and 5 deletions

View File

@ -42,11 +42,11 @@ object features {
"Standard chess and ",
a(href := routes.Page.variantHome)("8 chess variants (Crazyhouse, Chess960, Horde, ...)")
),
tr(custom("35 per day"))(
tr(custom(s"${lila.fishnet.FishnetLimiter.maxPerDay} per day"))(
"Deep Stockfish 14+ server analysis"
),
tr(unlimited)(
"Instant local Stockfish 14+ analysis"
"Instant local Stockfish 14+ analysis (depth 99)"
),
tr(unlimited)(
a(href := "https://lichess.org/blog/WN-gLzAAAKlI89Xn/thousands-of-stockfish-analysers")(

View File

@ -11,6 +11,8 @@ final private class FishnetLimiter(
requesterApi: lila.analyse.RequesterApi
)(implicit ec: scala.concurrent.ExecutionContext) {
import FishnetLimiter._
def apply(sender: Work.Sender, ignoreConcurrentCheck: Boolean, ownGame: Boolean): Fu[Boolean] =
(fuccess(ignoreConcurrentCheck) >>| concurrentCheck(sender)) flatMap {
case false => fuFalse
@ -38,9 +40,6 @@ final private class FishnetLimiter(
case _ => fuFalse
}
private val maxPerDay = 35
private val maxPerWeek = 160
private def perDayCheck(sender: Work.Sender) =
sender match {
case Work.Sender(_, _, mod, system) if mod || system => fuTrue
@ -56,3 +55,8 @@ final private class FishnetLimiter(
case _ => fuFalse
}
}
object FishnetLimiter {
val maxPerDay = 40
val maxPerWeek = 200
}