Skip to content

Commit

Permalink
changes for multiple gacha also added here
Browse files Browse the repository at this point in the history
  • Loading branch information
iamananya committed Jun 7, 2023
1 parent 03a235f commit 5011527
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/models/gacha.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func CreateUserCharacterBatch(userCharacters []*UserCharacter) error {
}

batch := userCharacters[i:end]
if err := createBatch(tx, batch); err != nil {
if err := batchCreation(tx, batch); err != nil {
tx.Rollback()
return err
}
Expand All @@ -200,7 +200,7 @@ func CreateUserCharacterBatch(userCharacters []*UserCharacter) error {
return nil
}

func createBatch(tx *gorm.DB, batch []*UserCharacter) error {
func batchCreation(tx *gorm.DB, batch []*UserCharacter) error {
for _, uc := range batch {
if err := tx.Create(&uc).Error; err != nil {
return err
Expand Down

0 comments on commit 5011527

Please sign in to comment.