Skip to content

Commit

Permalink
Skip expensive queries when not used
Browse files Browse the repository at this point in the history
  • Loading branch information
Syriiin committed Nov 30, 2024
1 parent b4a4ac0 commit bf5f8e9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions leaderboards/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ def update_membership(
rank=leaderboard.member_count + 1,
)

# Get leaderboard records before updating, so we can compare
pp_record = leaderboard.get_pp_record()
leaderboard_top_player = leaderboard.get_top_membership()
if not skip_notifications and leaderboard.notification_discord_webhook_url != "":
# Get leaderboard records before updating, so we can compare for notifications
pp_record = leaderboard.get_pp_record()
leaderboard_top_player = leaderboard.get_top_membership()

scores = Score.objects.filter(
user_stats__user_id=user_id, user_stats__gamemode=leaderboard.gamemode
Expand Down

0 comments on commit bf5f8e9

Please sign in to comment.