Conversation
msaroufim
reviewed
Feb 27, 2026
msaroufim
reviewed
Feb 27, 2026
msaroufim
reviewed
Feb 27, 2026
msaroufim
reviewed
Feb 27, 2026
msaroufim
reviewed
Feb 27, 2026
|
|
||
| try: | ||
| key = f"{CACHE_KEY_PREFIX}{leaderboard_id}" | ||
| redis_conn.set(key, json.dumps(top_users)) |
Member
There was a problem hiding this comment.
one issue here is we sometimes reopen leaderboards and we frequently extend deadlines
Collaborator
Author
There was a problem hiding this comment.
if we extend deadline, it will be recognized as active leaderboard, it will fetch as active leaderboard
Member
There was a problem hiding this comment.
But we'd need to call force rest cache IIUC
Collaborator
Author
There was a problem hiding this comment.
ah i see,my bad,
here is updated logics.
- make sure to remove active leaderboard from cache if it's active now
- cache all ended leaderboard
- query all active leaderboard
- merge all leaderboard results
when leaderboard ended, it will be cached again.
Collaborator
Author
|
Member
|
Alright let's merge this. I am a tiny bit spooked about how this'll work in practice though. But let's monitor and improve for now. Cc @S1ro1 |
msaroufim
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By default, we still use the original logics, and enable cache if v1_query exists.
Cache leaderboard top 3 users only when leaderboard is ended.
Run with cache:
http://localhost:5000/home?use_beta
forch refresh: recalculate everything. this should exist just in case, ended leaderboard need refresh for deleted submission etc
http://localhost:5000/home?use_beta&force_refresh