parent
7d03b2537e
commit
4459934596
|
@ -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
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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)))
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue