seller id deadlock and delete elapsed time

This commit is contained in:
merdan 2022-09-22 16:44:01 +05:00
parent 42253f230f
commit e1e0756b40
1 changed files with 2 additions and 2 deletions

View File

@ -597,7 +597,7 @@ func ImportProduct(product models.Product, db *gorm.DB) error {
flatVariant.ProductID = sizeVariantProduct.ID
if errVariant := db.Create(&flatVariant).Error; errVariant != nil {
if errVariant := tx.Create(&flatVariant).Error; errVariant != nil {
log.Println(errVariant)
tx.RollbackTo(sizeSavePoint)
continue
@ -851,7 +851,7 @@ func UpdateProduct(product models.Product, db *gorm.DB, productFlat gm.ProductFl
} else if len(product.ColorVariants) > 0 {
//todo update configurable product
product.ColorVariants = append(product.ColorVariants, product)
//tx := db.Begin()
for _, colorVariant := range product.ColorVariants {
if len(colorVariant.SizeVariants) > 0 {