Skip to content

refactor: bulk update for player/map ranking - #127

Merged
ahmadbky merged 2 commits into
masterfrom
125-make-a-bulk-update-instead-of-queries-in-loop
Mar 30, 2026
Merged

refactor: bulk update for player/map ranking#127
ahmadbky merged 2 commits into
masterfrom
125-make-a-bulk-update-instead-of-queries-in-loop

Conversation

@ahmadbky

Copy link
Copy Markdown
Member

Closes: #125.

@ahmadbky
ahmadbky requested a review from Copilot March 29, 2026 19:28
@ahmadbky ahmadbky linked an issue Mar 29, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the SOCC player/map ranking updater to avoid per-row SQL updates by performing chunked bulk updates, addressing Issue #125’s “queries in loop” problem.

Changes:

  • Replaces per-entity updates with update_many() + CASE WHEN bulk updates (chunked to stay under bind-parameter limits).
  • Builds Redis ZADD pipeline while iterating scores, then executes it after the SQL transaction.
  • Changes update() to log success/error instead of propagating do_update() failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/socc/src/player_ranking.rs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ahmadbky
ahmadbky merged commit 04c00ec into master Mar 30, 2026
7 checks passed
@ahmadbky
ahmadbky deleted the 125-make-a-bulk-update-instead-of-queries-in-loop branch March 30, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make a bulk update instead of queries in loop

2 participants