preload user games' tournaments
This commit is contained in:
parent
08fb8c7aff
commit
5807044640
|
@ -108,6 +108,7 @@ object User extends LilaController {
|
|||
me = ctx.me,
|
||||
page = page)(ctx.body)
|
||||
_ <- Env.user.lightUserApi preloadMany pag.currentPageResults.flatMap(_.userIds)
|
||||
_ <- Env.tournament.cached.nameCache preloadMany pag.currentPageResults.flatMap(_.tournamentId)
|
||||
_ <- Env.team.cached.nameCache preloadSet info.teamIds
|
||||
relation <- ctx.userId ?? { relationApi.fetchRelation(_, u.id) }
|
||||
notes <- ctx.me ?? { me =>
|
||||
|
|
|
@ -8,7 +8,7 @@ private[tournament] final class Cached(
|
|||
createdTtl: FiniteDuration,
|
||||
rankingTtl: FiniteDuration)(implicit system: akka.actor.ActorSystem) {
|
||||
|
||||
private val nameCache = new Syncache[String, Option[String]](
|
||||
val nameCache = new Syncache[String, Option[String]](
|
||||
name = "tournament.name",
|
||||
compute = id => TournamentRepo byId id map2 { (tour: Tournament) => tour.fullName },
|
||||
default = _ => none,
|
||||
|
|
Loading…
Reference in a new issue