fix(topup): settle recharge orders atomically
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user