Revert "Add socket debug info"

This reverts commit e58a959bba.
lobbyRemoteSocket
Thibault Duplessis 2019-07-18 11:30:06 +02:00
parent 7d03b2537e
commit 4459934596
8 changed files with 5 additions and 37 deletions

View File

@ -20,7 +20,6 @@ object Dev extends LilaController {
Env.api.cspEnabledSetting,
Env.streamer.alwaysFeaturedSetting,
Env.rating.ratingFactorsSetting,
Env.socket.socketDebugSetting,
Env.api.serviceWorkerSetting,
Env.plan.donationGoalSetting,
Env.rating.deviationIncreaseOverTimeSetting

View File

@ -391,7 +391,7 @@ lazy val tree = module("tree", Seq(common)).settings(
)
lazy val socket = module("socket", Seq(common, hub, memo, tree)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, lettuce)
libraryDependencies ++= provided(play.api, lettuce)
)
lazy val hub = module("hub", Seq(common)).settings(

View File

@ -36,8 +36,7 @@ final class Env(
evalCacheHandler: lila.evalCache.EvalCacheSocketHandler,
isBotSync: lila.common.LightUser.IsBotSync,
slackApi: lila.slack.SlackApi,
ratingFactors: () => lila.rating.RatingFactors,
val socketDebug: () => Boolean
ratingFactors: () => lila.rating.RatingFactors
) {
private val settings = new {
@ -279,7 +278,6 @@ object Env {
evalCacheHandler = lila.evalCache.Env.current.socketHandler,
isBotSync = lila.user.Env.current.lightUserApi.isBotSync,
slackApi = lila.slack.Env.current.api,
ratingFactors = lila.rating.Env.current.ratingFactorsSetting.get,
socketDebug = lila.socket.Env.current.socketDebugSetting.get
ratingFactors = lila.rating.Env.current.ratingFactorsSetting.get
)
}

View File

@ -33,13 +33,6 @@ private final class History(
versionHolder
}
def versionDebugString: String = {
waitForLoadedEvents
Option(events.peekLast).fold("-:-") { l =>
s"${events.peekFirst}:${l.version}@${l.date - nowSeconds}s"
}
}
def getEventsSince(v: SocketVersion, mon: Option[lila.mon.round.history.PlatformHistory]): EventResult = {
val version = getVersion
if (v > version) VersionTooHigh

View File

@ -285,11 +285,6 @@ private[round] final class RoundSocket(
case many => makeMessage("b", many map (_ jsFor member)).some
}
def batchMsgsDebug(member: Member, vevents: List[VersionedEvent], debug: => String) = {
if (Env.current.socketDebug()) makeMessageDebug("b", vevents map (_ jsFor member), debug).some
else batchMsgs(member, vevents)
}
def notifyOwner[A: Writes](color: Color, t: String, data: A) =
withOwnerOf(color) {
_ push makeMessage(t, data)

View File

@ -11,8 +11,7 @@ final class Env(
system: ActorSystem,
config: Config,
lifecycle: play.api.inject.ApplicationLifecycle,
hub: lila.hub.Env,
settingStore: lila.memo.SettingStore.Builder
hub: lila.hub.Env
) {
private val RedisUri = config getString "redis.uri"
@ -34,12 +33,6 @@ final class Env(
)
system.scheduler.schedule(5 seconds, 1 seconds) { population ! PopulationTell }
val socketDebugSetting = settingStore[Boolean](
"socketDebug",
default = false,
text = "Send extra debugging to websockets.".some
)
}
object Env {
@ -48,7 +41,6 @@ object Env {
system = lila.common.PlayApp.system,
config = lila.common.PlayApp loadConfig "socket",
lifecycle = lila.common.PlayApp.lifecycle,
hub = lila.hub.Env.current,
settingStore = lila.memo.Env.current.settingStore
hub = lila.hub.Env.current
)
}

View File

@ -29,11 +29,6 @@ object Socket extends Socket {
}
private[socket] trait Socket {
def makeMessageDebug[A](t: String, data: A, debug: String)(implicit writes: Writes[A]): JsObject =
JsObject(new Map.Map3("t", JsString(t), "d", writes.writes(data), "debug", JsString(debug)))
def makeMessageDebug[A](t: String, debug: String): JsObject =
JsObject(new Map.Map2("t", JsString(t), "debug", JsString(debug)))
def makeMessage[A](t: String, data: A)(implicit writes: Writes[A]): JsObject =
JsObject(new Map.Map2("t", JsString(t), "d", writes.writes(data)))

View File

@ -180,10 +180,6 @@ object SocketTrouper extends Socket {
case class GetNbMembers(promise: Promise[Int])
val resyncMessage = makeMessage("resync")
def resyncMsgWithDebug(debug: => String) =
if (Env.current.socketDebugSetting.get) makeMessageDebug("resync", debug)
else resyncMessage
}
// Not managed by a TrouperMap