Skip to content

Commit

Permalink
remove analysis socket
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 16, 2019
1 parent 5d1fe65 commit 64a9255
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 92 deletions.
6 changes: 0 additions & 6 deletions app/controllers/UserAnalysis.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ object UserAnalysis extends LilaController with TheftPrevention {
}
}

def socket(apiVersion: Int) = SocketOption { implicit ctx =>
getSocketSri("sri") ?? { sri =>
Env.analyse.socketHandler.join(sri, ctx.me, apiVersion) map some
}
}

// XHR only
def pgn = OpenBody { implicit ctx =>
implicit val req = ctx.body
Expand Down
3 changes: 0 additions & 3 deletions conf/base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ bookmark {
actor.name = bookmark
}
analyse {
socket {
sri.ttl = ${site.socket.sri.ttl}
}
collection.analysis = analysis2
collection.requester = analysis_requester
net.domain = ${net.domain}
Expand Down
2 changes: 0 additions & 2 deletions conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ POST /training/:id/attempt controllers.Puzzle.round(id: Int)

# User Analysis
# mobile app sends no site socket version: default to v3
GET /analysis/socket controllers.UserAnalysis.socket(apiVersion: Int = 3)
GET /analysis/socket/v:apiVersion controllers.UserAnalysis.socket(apiVersion: Int)
GET /analysis/help controllers.UserAnalysis.help
GET /analysis/*something controllers.UserAnalysis.parse(something: String)
GET /analysis controllers.UserAnalysis.index
Expand Down
39 changes: 0 additions & 39 deletions modules/analyse/src/main/AnalyseSocket.scala

This file was deleted.

30 changes: 0 additions & 30 deletions modules/analyse/src/main/AnalyseSocketHandler.scala

This file was deleted.

15 changes: 3 additions & 12 deletions modules/analyse/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ import com.typesafe.config.Config
final class Env(
config: Config,
db: lila.db.Env,
system: ActorSystem,
evalCacheHandler: lila.evalCache.EvalCacheSocketHandler,
hub: lila.hub.Env,
bus: lila.common.Bus,
indexer: ActorSelection
) {

private val CollectionAnalysis = config getString "collection.analysis"
private val CollectionRequester = config getString "collection.requester"
private val NetDomain = config getString "net.domain"
private val SocketSriTtl = config duration "socket.sri.ttl"

lazy val analysisColl = db(CollectionAnalysis)

Expand All @@ -24,24 +21,18 @@ final class Env(
lazy val analyser = new Analyser(
indexer = indexer,
requesterApi = requesterApi,
bus = system.lilaBus
bus = bus
)

lazy val annotator = new Annotator(NetDomain)

private val socket = new AnalyseSocket(system, SocketSriTtl)

lazy val socketHandler = new AnalyseSocketHandler(socket, hub, evalCacheHandler)
}

object Env {

lazy val current = "analyse" boot new Env(
config = lila.common.PlayApp loadConfig "analyse",
db = lila.db.Env.current,
system = lila.common.PlayApp.system,
evalCacheHandler = lila.evalCache.Env.current.socketHandler,
hub = lila.hub.Env.current,
bus = lila.common.PlayApp.system.lilaBus,
indexer = lila.hub.Env.current.gameSearch
)
}

0 comments on commit 64a9255

Please sign in to comment.