remove useless user count

This commit is contained in:
Thibault Duplessis 2016-07-17 23:14:12 +02:00
parent e84afea487
commit 9f6109c0df
4 changed files with 2 additions and 11 deletions

View file

@ -31,7 +31,6 @@ final class Env(
lightUser = Env.user.lightUser)
lazy val userInfo = mashup.UserInfo(
countUsers = () => Env.user.countEnabled,
bookmarkApi = Env.bookmark.api,
relationApi = Env.relation.api,
trophyApi = Env.user.trophyApi,

View file

@ -15,7 +15,6 @@ import lila.user.{ User, Trophy, Trophies, TrophyApi }
case class UserInfo(
user: User,
ranks: lila.rating.UserRankMap,
nbUsers: Int,
nbPlaying: Int,
hasSimul: Boolean,
crosstable: Option[Crosstable],
@ -55,7 +54,6 @@ case class UserInfo(
object UserInfo {
def apply(
countUsers: () => Fu[Int],
bookmarkApi: BookmarkApi,
relationApi: RelationApi,
trophyApi: TrophyApi,
@ -70,8 +68,7 @@ object UserInfo {
isStreamer: String => Boolean,
insightShare: lila.insight.Share,
getPlayTime: User => Fu[User.PlayTime])(user: User, ctx: Context): Fu[UserInfo] =
countUsers() zip
getRanks(user.id) zip
getRanks(user.id) zip
(gameCached nbPlaying user.id) zip
gameCached.nbImportedBy(user.id) zip
(ctx.me.filter(user!=) ?? { me => crosstableApi(me.id, user.id) }) zip
@ -84,12 +81,11 @@ object UserInfo {
trophyApi.findByUser(user) zip
(user.count.rated >= 10).??(insightShare.grant(user, ctx.me)) zip
getPlayTime(user) flatMap {
case (((((((((((((nbUsers, ranks), nbPlaying), nbImported), crosstable), ratingChart), nbFollowers), nbBlockers), nbPosts), nbStudies), isDonor), trophies), insightVisible), playTime) =>
case ((((((((((((ranks, nbPlaying), nbImported), crosstable), ratingChart), nbFollowers), nbBlockers), nbPosts), nbStudies), isDonor), trophies), insightVisible), playTime) =>
(nbPlaying > 0) ?? isHostingSimul(user.id) map { hasSimul =>
new UserInfo(
user = user,
ranks = ranks,
nbUsers = nbUsers,
nbPlaying = nbPlaying,
hasSimul = hasSimul,
crosstable = crosstable,

View file

@ -28,8 +28,6 @@ final class Cached(
f = userColl.count(UserRepo.enabledSelect.some),
timeToLive = nbTtl)
def countEnabled: Fu[Int] = countCache(true)
private implicit val LightUserBSONHandler = Macros.handler[LightUser]
private implicit val LightPerfBSONHandler = Macros.handler[LightPerf]
private implicit val LightCountBSONHandler = Macros.handler[LightCount]

View file

@ -45,8 +45,6 @@ final class Env(
def isOnline(userId: String) = onlineUserIdMemo get userId
def countEnabled = cached.countEnabled
def cli = new lila.common.Cli {
def process = {
case "user" :: "email" :: userId :: email :: Nil =>