parent
f619fe53aa
commit
bfaab3943c
|
@ -29,7 +29,7 @@ object Lobby extends LilaController {
|
|||
def renderHome[A](status: Results.Status)(implicit ctx: Context): Fu[SimpleResult] =
|
||||
Env.current.preloader(
|
||||
posts = Env.forum.recent(ctx.me, Env.team.cached.teamIds.apply),
|
||||
tours = TournamentRepo.allCreatedSorted,
|
||||
tours = Env.tournament.allCreatedSorted(true),
|
||||
filter = Env.setup.filter
|
||||
).map(_.fold(Redirect(_), {
|
||||
case (preload, entries, posts, tours, featured, leaderboard, progress, puzzle) =>
|
||||
|
|
|
@ -40,7 +40,7 @@ object Tournament extends LilaController {
|
|||
}
|
||||
|
||||
private def fetchTournaments =
|
||||
repo.allCreatedSorted zip repo.started zip repo.finished(20)
|
||||
env allCreatedSorted true zip repo.started zip repo.finished(20)
|
||||
|
||||
def show(id: String) = Open { implicit ctx =>
|
||||
repo byId id flatMap {
|
||||
|
|
|
@ -25,6 +25,7 @@ final class Env(
|
|||
private val settings = new {
|
||||
val CollectionTournament = config getString "collection.tournament"
|
||||
val MessageTtl = config duration "message.ttl"
|
||||
val CreatedCacheTtl = config duration "created.cache.ttl"
|
||||
val UidTimeout = config duration "uid.timeout"
|
||||
val SocketTimeout = config duration "socket.timeout"
|
||||
val SocketName = config getString "socket.name"
|
||||
|
@ -75,6 +76,9 @@ final class Env(
|
|||
def version(tourId: String): Fu[Int] =
|
||||
socketHub ? Ask(tourId, GetVersion) mapTo manifest[Int]
|
||||
|
||||
val allCreatedSorted =
|
||||
lila.memo.AsyncCache.single(TournamentRepo.allCreatedSorted, timeToLive = CreatedCacheTtl)
|
||||
|
||||
def cli = new lila.common.Cli {
|
||||
import tube.tournamentTube
|
||||
def process = {
|
||||
|
@ -95,7 +99,7 @@ final class Env(
|
|||
organizer -> actorApi.StartedTournaments
|
||||
}
|
||||
|
||||
scheduler.message(1 minute) {
|
||||
scheduler.message(5 minutes) {
|
||||
tournamentScheduler -> actorApi.ScheduleNow
|
||||
}
|
||||
tournamentScheduler ! actorApi.ScheduleNow
|
||||
|
|
Loading…
Reference in a new issue