diff --git a/conf/base.conf b/conf/base.conf index c2568e27f4..4a0673f0e4 100644 --- a/conf/base.conf +++ b/conf/base.conf @@ -548,6 +548,10 @@ importer { } mobile.app.version = "1.3.0" coach { + mongodb { + uri = "mongodb://127.0.0.1:27037/lichess" + mongo-async-driver = {} + } collection { entry = coach_entry } diff --git a/modules/coach/src/main/Env.scala b/modules/coach/src/main/Env.scala index 699b81228c..2e4def5d78 100644 --- a/modules/coach/src/main/Env.scala +++ b/modules/coach/src/main/Env.scala @@ -13,13 +13,15 @@ final class Env( areFriends: (String, String) => Fu[Boolean], lightUser: String => Option[lila.common.LightUser], system: ActorSystem, - db: lila.db.Env) { + lifecycle: play.api.inject.ApplicationLifecycle) { private val settings = new { val CollectionEntry = config getString "collection.entry" } import settings._ + private val db = new lila.db.Env(config getConfig "mongodb", lifecycle) + // private lazy val jsonWriters = new JSONWriters(lightUser = lightUser) lazy val share = new Share(getPref, areFriends) @@ -41,5 +43,5 @@ object Env { areFriends = lila.relation.Env.current.api.areFriends, lightUser = lila.user.Env.current.lightUser, system = lila.common.PlayApp.system, - db = lila.db.Env.current) + lifecycle = lila.common.PlayApp.lifecycle) }