seller id deadlock and delete elapsed time
This commit is contained in:
parent
42253f230f
commit
e1e0756b40
|
|
@ -597,7 +597,7 @@ func ImportProduct(product models.Product, db *gorm.DB) error {
|
||||||
|
|
||||||
flatVariant.ProductID = sizeVariantProduct.ID
|
flatVariant.ProductID = sizeVariantProduct.ID
|
||||||
|
|
||||||
if errVariant := db.Create(&flatVariant).Error; errVariant != nil {
|
if errVariant := tx.Create(&flatVariant).Error; errVariant != nil {
|
||||||
log.Println(errVariant)
|
log.Println(errVariant)
|
||||||
tx.RollbackTo(sizeSavePoint)
|
tx.RollbackTo(sizeSavePoint)
|
||||||
continue
|
continue
|
||||||
|
|
@ -851,7 +851,7 @@ func UpdateProduct(product models.Product, db *gorm.DB, productFlat gm.ProductFl
|
||||||
} else if len(product.ColorVariants) > 0 {
|
} else if len(product.ColorVariants) > 0 {
|
||||||
//todo update configurable product
|
//todo update configurable product
|
||||||
product.ColorVariants = append(product.ColorVariants, product)
|
product.ColorVariants = append(product.ColorVariants, product)
|
||||||
|
//tx := db.Begin()
|
||||||
for _, colorVariant := range product.ColorVariants {
|
for _, colorVariant := range product.ColorVariants {
|
||||||
|
|
||||||
if len(colorVariant.SizeVariants) > 0 {
|
if len(colorVariant.SizeVariants) > 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue