fix(topup): settle recharge orders atomically

This commit is contained in:
CaIon
2026-08-11 22:03:47 +08:00
parent d7992672a6
commit 50e5377ea5
7 changed files with 367 additions and 82 deletions
+1
View File
@@ -181,6 +181,7 @@ func Redeem(key string, userId int) (quota int, err error) {
common.SysError("redemption failed: " + err.Error())
return 0, ErrRedeemFailed
}
syncCreditUserQuotaCache(userId, redemption.Quota, "redemption")
RecordLog(userId, LogTypeTopup, fmt.Sprintf("通过兑换码充值 %s,兑换码ID %d", logger.LogQuota(redemption.Quota), redemption.Id))
return redemption.Quota, nil
}