优化杀分逻辑

This commit is contained in:
2026-03-17 15:36:14 +08:00
parent 1892c7bcb7
commit 150d31eac5
9 changed files with 38 additions and 37 deletions

View File

@@ -115,7 +115,7 @@ Goal: hot paths should hit Redis most of the time, and DB should primarily be fo
- In `playStart`, ensure player is loaded once and reused (do not call `DicePlayer::find` multiple times per request).
3. EV update strategy:
- Repeated `UPDATE dice_lottery_config SET ev = ev - ?` on a hot row causes lock contention.
- Repeated `UPDATE dice_lottery_pool_config SET ev = ev - ?` on a hot row causes lock contention.
- Better:
- Accumulate EV deltas in Redis (per pool or per shard).
- Periodic cron job to aggregate Redis deltas back into MySQL in batches.