forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Env.scala
29 lines (21 loc) · 743 Bytes
/
Env.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package lila.history
import com.typesafe.config.Config
import lila.common.PimpedConfig._
final class Env(
config: Config,
mongoCache: lila.memo.MongoCache.Builder,
db: lila.db.Env) {
private val CachedRatingChartTtl = config duration "cached.rating_chart.ttl"
private val Collectionhistory = config getString "collection.history"
lazy val api = new HistoryApi(db(Collectionhistory))
lazy val ratingChartApi = new RatingChartApi(
historyApi = api,
mongoCache = mongoCache,
cacheTtl = CachedRatingChartTtl)
}
object Env {
lazy val current = "history" boot new Env(
config = lila.common.PlayApp loadConfig "history",
mongoCache = lila.memo.Env.current.mongoCache,
db = lila.db.Env.current)
}