Running into an issue where two independent reward systems can fire close together and one of the rewards gets lost. Both reward handlers complete according to my logs, but sometimes they read the same starting balance and the second update overwrites the first.
local balance = MySQL.scalar.await('SELECT balance FROM accounts WHERE id = ?', { id })
MySQL.update.await('UPDATE accounts SET balance = ? WHERE id = ?', { balance + reward, id })The timestamps in my logs show both handlers fired and completed successfully, but the final balance only reflects one of the rewards. This happens intermittently when rewards trigger within a short window of each other. Using oxmysql with standard ESX setup - initially thought it was a callback library issue but the timing suggests it's the database read/write pattern.
MrNugget · 26/08/2026
Sign in to reply.