Skip to content

Commit

Permalink
Merge branch 'master' into topnav-tweaks-v2
Browse files Browse the repository at this point in the history
* master:
  /broadcast title font size middle ground
  tweak relay leaderboard caches
  New Crowdin updates (#14891)
  numbers that can go up, must go up
  use relay player elo for leaderboard sorting
  larger title for cards
  • Loading branch information
ornicar committed Mar 18, 2024
2 parents e9a2128 + cbfa10b commit fc55dd5
Show file tree
Hide file tree
Showing 54 changed files with 965 additions and 971 deletions.
7 changes: 4 additions & 3 deletions modules/relay/src/main/RelayLeaderboard.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ final class RelayLeaderboardApi(
cache.get(tour.id)

private val invalidateDebouncer =
lila.common.Debouncer[RelayTour.Id](10 seconds, 64)(id => cache.put(id, computeJson(id)))
lila.common.Debouncer[RelayTour.Id](3 seconds, 32)(id => cache.put(id, computeJson(id)))

def invalidate(id: RelayTour.Id) = invalidateDebouncer.push(id)

private val cache = cacheApi[RelayTour.Id, JsonStr](256, "relay.leaderboard"):
private val cache = cacheApi[RelayTour.Id, JsonStr](32, "relay.leaderboard"):
_.expireAfterWrite(10 minutes).buildAsyncFuture(computeJson)

private def computeJson(id: RelayTour.Id): Fu[JsonStr] =
Expand Down Expand Up @@ -88,7 +88,8 @@ final class RelayLeaderboardApi(
federations <- playerApi.federationsOf(players.values.flatMap(_._5).toList)
yield RelayLeaderboard:
players.toList
.sortBy(-_._2._1)
.sortBy: (_, player) =>
(-player._1, -player._3.so(_.value))
.map:
case (name, (score, played, rating, title, fideId)) =>
val fed = fideId.flatMap(federations.get)
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
},
"dependencies": {
"@types/lichess": "workspace:*",
"@types/node": "^20.9.1",
"@types/web": "^0.0.119",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"@types/node": "^20.11.28",
"@types/web": "^0.0.142",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"ab": "github:lichess-org/ab-stub",
"chessground": "^9.0.4",
"eslint": "^8.54.0",
"lint-staged": "^15.1.0",
"eslint": "^8.57.0",
"lint-staged": "^15.2.2",
"onchange": "^7.1.0",
"prettier": "3.0.2",
"typescript": "^5.2.2"
"typescript": "^5.4.2"
},
"scripts": {
"format": "prettier --write --log-level warn .",
Expand All @@ -49,6 +49,6 @@
"metals": "tail -F .metals/metals.log | stdbuf -oL cut -c 21- | rg -v '(notification for request|handleCancellation)'",
"serverlog": "pnpm journal & pnpm metals",
"multilog": "pnpm serverlog & ui/build -r",
"minilog": "pnpm journal | grep -E -v fishnet & ui/build -dr"
"minilog": "pnpm journal | grep -E -v fishnet & ui/build -cdrs"
}
}
Loading

0 comments on commit fc55dd5

Please sign in to comment.