Skip to content

Commit

Permalink
rename YoloDb
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 16, 2021
1 parent 0994937 commit 5cc2c0f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion conf/base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ https.port = disabled
mongodb {
uri = "mongodb:https://127.0.0.1:27017?appName=lila"
mongo-async-driver = ${akka}
junk {
yolo {
uri = ${mongodb.uri}
# uri = "mongodb:https://127.0.0.1:27010?appName=lila&connectTimeoutMS=800&rm.maxNonQueryableHeartbeats=9999"
}
Expand Down
2 changes: 1 addition & 1 deletion modules/activity/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import lila.common.config._
import lila.hub.actorApi.round.CorresMoveEvent

final class Env(
db: lila.db.AsyncDb @@ lila.db.JunkDb,
db: lila.db.AsyncDb @@ lila.db.YoloDb,
practiceApi: lila.practice.PracticeApi,
gameRepo: lila.game.GameRepo,
forumPostApi: lila.forum.PostApi,
Expand Down
11 changes: 6 additions & 5 deletions modules/db/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import scala.concurrent.ExecutionContext

import lila.common.Lilakka

trait JunkDb
// weakly replicated DB for low value documents
trait YoloDb

@Module
final class Env(
Expand All @@ -26,11 +27,11 @@ final class Env(
driver = driver
)

lazy val junkDb = new AsyncDb(
name = "junk",
uri = appConfig.get[String]("mongodb.junk.uri"),
lazy val yoloDb = new AsyncDb(
name = "yolo",
uri = appConfig.get[String]("mongodb.yolo.uri"),
driver = driver
).taggedWith[JunkDb]
).taggedWith[YoloDb]

def asyncDb(name: String, uri: String) =
new AsyncDb(
Expand Down
2 changes: 1 addition & 1 deletion modules/history/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class Env(
mongoCache: lila.memo.MongoCache.Api,
userRepo: lila.user.UserRepo,
cacheApi: lila.memo.CacheApi,
db: lila.db.AsyncDb @@ lila.db.JunkDb
db: lila.db.AsyncDb @@ lila.db.YoloDb
)(implicit
ec: scala.concurrent.ExecutionContext,
system: ActorSystem
Expand Down

0 comments on commit 5cc2c0f

Please sign in to comment.