remove friendListToggle dead code

pull/7194/head
Thibault Duplessis 2020-08-26 09:55:14 +02:00
parent 176bb46216
commit ae9d53d472
3 changed files with 4 additions and 18 deletions

View File

@ -1,9 +1,9 @@
package controllers
import play.api.data._, Forms._
import views._
import lila.app._
import views._
final class Dev(env: Env) extends LilaController(env) {
@ -38,24 +38,12 @@ final class Dev(env: Env) extends LilaController(env) {
.bindFromRequest()
.fold(
_ => BadRequest(html.dev.settings(settingsList)).fuccess,
v => {
setting.setString(v.toString) inject {
(setting.id, setting.get()) match {
case ("friendListToggle", v: Boolean) => env.api.influxEvent.friendListToggle(v)
case _ =>
}
Redirect(routes.Dev.settings())
}
}
v => setting.setString(v.toString) inject Redirect(routes.Dev.settings())
)
}
}
private val commandForm = Form(
single(
"command" -> nonEmptyText
)
)
private val commandForm = Form(single("command" -> nonEmptyText))
def cli =
Secure(_.Cli) { implicit ctx => _ =>

View File

@ -78,7 +78,7 @@ final class Env(
lazy val cli = wire[Cli]
lazy val influxEvent = new InfluxEvent(
private lazy val influxEvent = new InfluxEvent(
ws = ws,
endpoint = config.influxEventEndpoint,
env = config.influxEventEnv

View File

@ -13,8 +13,6 @@ final class InfluxEvent(
def start() = apply("lila_start", s"Lila starts: $seed")
def friendListToggle(value: Boolean) = apply(s"friend_list_$value", s"Toggle friend list: $value")
private def apply(key: String, text: String) =
ws.url(endpoint)
.post(s"""event,program=lila,env=$env,title=$key text="$text"""")