remove huffman live setting
This commit is contained in:
parent
804e5911ab
commit
3c197e0f26
|
@ -14,8 +14,7 @@ object Dev extends LilaController {
|
|||
Env.irwin.irwinModeSetting,
|
||||
Env.api.assetVersionSetting,
|
||||
Env.explorer.indexFlowSetting,
|
||||
Env.report.scoreThresholdSetting,
|
||||
Env.game.pgnEncodingSetting
|
||||
Env.report.scoreThresholdSetting
|
||||
)
|
||||
|
||||
def settings = Secure(_.Settings) { implicit ctx => me =>
|
||||
|
|
|
@ -31,12 +31,6 @@ final class Env(
|
|||
}
|
||||
import settings._
|
||||
|
||||
lazy val pgnEncodingSetting = settingStore[String](
|
||||
"pgnEncodingSetting",
|
||||
default = "all",
|
||||
text = "Use Huffman encoding for game PGN [none|all|regex]".some
|
||||
)
|
||||
|
||||
lazy val gameColl = db(CollectionGame)
|
||||
|
||||
lazy val pngExport = new PngExport(PngUrl, PngSize)
|
||||
|
|
|
@ -73,23 +73,6 @@ private object PgnStorage {
|
|||
castles: Castles // irrelevant after game ends
|
||||
)
|
||||
|
||||
private def shouldUseHuffman(variant: Variant, playerUserIds: List[lila.user.User.ID]) = variant.standard && {
|
||||
try {
|
||||
lila.game.Env.current.pgnEncodingSetting.get() match {
|
||||
case "all" => true
|
||||
case "none" => false
|
||||
case regex if playerUserIds.exists(_ matches regex) => true
|
||||
case _ => false
|
||||
}
|
||||
} catch {
|
||||
case e: Throwable =>
|
||||
println(e)
|
||||
false // breaks in tests. The shouldUseHuffman function is temporary anyway
|
||||
}
|
||||
}
|
||||
private[game] def apply(variant: Variant, playerUserIds: List[lila.user.User.ID]): PgnStorage =
|
||||
if (shouldUseHuffman(variant, playerUserIds)) Huffman else OldBin
|
||||
|
||||
private def monitor[A](mon: lila.mon.game.pgn.Protocol)(f: => A): A = {
|
||||
mon.count()
|
||||
lila.mon.measureRec(mon.time)(f)
|
||||
|
|
Loading…
Reference in a new issue