disable "players today" because of a probably RM issue
parent
fdccca241c
commit
eade014bba
|
@ -132,11 +132,12 @@ object User extends LilaController {
|
|||
for {
|
||||
leaderboards <- env.cached.leaderboards
|
||||
nbAllTime ← env.cached topNbGame nb
|
||||
nbDay ← Env.game.cached activePlayerUidsDay nb map {
|
||||
_ flatMap { pair =>
|
||||
env lightUser pair.userId map { UserModel.LightCount(_, pair.nb) }
|
||||
}
|
||||
}
|
||||
nbDay ← fuccess(Nil)
|
||||
// Env.game.cached activePlayerUidsDay nb map {
|
||||
// _ flatMap { pair =>
|
||||
// env lightUser pair.userId map { UserModel.LightCount(_, pair.nb) }
|
||||
// }
|
||||
// }
|
||||
tourneyWinners ← Env.tournament.winners scheduled nb
|
||||
online ← env.cached top50Online true
|
||||
res <- negotiate(
|
||||
|
|
|
@ -91,19 +91,18 @@ description = "Best chess players in bullet, blitz, classical, Chess960 and more
|
|||
<div class="group">
|
||||
@userTopPerf(leaderboards.blitz, PerfType.Blitz)
|
||||
@userTopPerf(leaderboards.chess960, PerfType.Chess960)
|
||||
@userTopActive(nbDay, trans.activeToday(), icon = 'U'.some)
|
||||
@userTopActive(nbAllTime, trans.activePlayers(), icon = 'U'.some)
|
||||
</div>
|
||||
|
||||
<div class="group">
|
||||
@userTopPerf(leaderboards.classical, PerfType.Classical)
|
||||
@userTopPerf(leaderboards.threeCheck, PerfType.ThreeCheck)
|
||||
@userTopActive(nbAllTime, trans.activePlayers(), icon = 'U'.some)
|
||||
@userTopPerf(leaderboards.antichess, PerfType.Antichess)
|
||||
</div>
|
||||
|
||||
<div class="group">
|
||||
@userTopPerf(leaderboards.kingOfTheHill, PerfType.KingOfTheHill)
|
||||
@userTopPerf(leaderboards.horde, PerfType.Horde)
|
||||
@userTopPerf(leaderboards.antichess, PerfType.Antichess)
|
||||
</div>
|
||||
|
||||
<div class="group">
|
||||
|
|
|
@ -29,10 +29,10 @@ final class Cached(
|
|||
val isRematch = new ExpireSetMemo(3.hours)
|
||||
|
||||
// very expensive
|
||||
val activePlayerUidsDay = mongoCache[Int, List[UidNb]](
|
||||
prefix = "player:active:day",
|
||||
(nb: Int) => GameRepo.activePlayersSince(DateTime.now minusDays 1, nb),
|
||||
timeToLive = 1 hour)
|
||||
// val activePlayerUidsDay = mongoCache[Int, List[UidNb]](
|
||||
// prefix = "player:active:day",
|
||||
// (nb: Int) => GameRepo.activePlayersSince(DateTime.now minusDays 1, nb),
|
||||
// timeToLive = 1 hour)
|
||||
|
||||
private val countShortTtl = AsyncCache[JsObject, Int](
|
||||
f = (o: JsObject) => $count(o),
|
||||
|
|
|
@ -377,7 +377,8 @@ object GameRepo {
|
|||
)
|
||||
).one[BSONDocument] map { ~_.flatMap(_.getAs[List[String]](F.playerUids)) }
|
||||
|
||||
def activePlayersSince(since: DateTime, max: Int): Fu[List[UidNb]] = {
|
||||
// #TODO this breaks it all since reactivemongo > 0.11.9
|
||||
def activePlayersSinceNOPENOPENOPE(since: DateTime, max: Int): Fu[List[UidNb]] = {
|
||||
import reactivemongo.api.collections.bson.BSONBatchCommands.AggregationFramework, AggregationFramework.{
|
||||
Descending,
|
||||
GroupField,
|
||||
|
|
Loading…
Reference in New Issue