Skip to content

Commit

Permalink
Decrease frequency of lb score cache update task
Browse files Browse the repository at this point in the history
  • Loading branch information
Syriiin committed Apr 15, 2024
1 parent a32aa68 commit 36a89c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion leaderboards/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def update_global_leaderboard_top_5_score_cache():
cache.set(
f"leaderboards::global_leaderboard_top_5_scores::{leaderboard.id}",
scores,
900,
1800,
)


Expand Down
2 changes: 1 addition & 1 deletion leaderboards/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def get(self, request, leaderboard_type, gamemode, leaderboard_id):
scores = cache.get_or_set(
f"leaderboards::global_leaderboard_top_5_scores::{leaderboard.id}",
lambda: leaderboard.get_top_scores(limit=limit),
900,
1800,
)
else:
scores = leaderboard.get_top_scores(limit=5)
Expand Down
4 changes: 2 additions & 2 deletions osuchan/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ class EnvSettings(BaseSettings):
"task": "profiles.tasks.dispatch_update_all_global_leaderboard_top_members",
"schedule": crontab(minute=0, hour=0), # midnight UTC
},
"update-global-leaderboard-top-5-score-cache-every-10-minutes": {
"update-global-leaderboard-top-5-score-cache-every-20-minutes": {
"task": "leaderboards.tasks.update_global_leaderboard_top_5_score_cache",
"schedule": crontab(minute="*/10"),
"schedule": crontab(minute="*/20"),
},
}

Expand Down

0 comments on commit 36a89c1

Please sign in to comment.