This commit is contained in:
CaIon committed 2024-04-04 19:18:00 +08:00
1 parent 78b114541d
commit 7b484beb18
3 files changed
+11 -1

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@ func Redeem(key string, userId int) (quota int, err error) {
if common.UsingPostgreSQL {
keyCol = `"key"`
}
common.RandomSleep()
err = DB.Transaction(func(tx *gorm.DB) error {
err := tx.Set("gorm:query_option", "FOR UPDATE").Where(keyCol+" = ?", key).First(redemption).Error
if err != nil {