remove huffman live setting

This commit is contained in:
Thibault Duplessis 2018-03-11 07:54:56 -05:00
parent 804e5911ab
commit 3c197e0f26
3 changed files with 1 additions and 25 deletions

View file

@ -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 =>

View file

@ -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)

View file

@ -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)