Add grade hot cache

This commit is contained in:
咕谷酱
2025-08-21 23:35:25 +08:00
parent 7c193937d1
commit 822d7c6377
13 changed files with 973 additions and 47 deletions

View File

@@ -421,7 +421,7 @@ class RankingCacheService:
select(User.country_code, func.count().label("user_count"))
.where(col(User.is_active).is_(True))
.group_by(User.country_code)
.order_by(col("user_count").desc())
.order_by(func.count().desc())
.limit(settings.ranking_cache_top_countries)
)
).all()