From 2664fd727533b036427378e09c351a3c19386b73 Mon Sep 17 00:00:00 2001 From: merdan Date: Sun, 25 Sep 2022 22:03:30 +0500 Subject: [PATCH] test --- controllers/ImportController.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/ImportController.go b/controllers/ImportController.go index 0110643..de94cec 100644 --- a/controllers/ImportController.go +++ b/controllers/ImportController.go @@ -254,11 +254,13 @@ func ImportProduct(product models.Product, db *gorm.DB) error { famAndSellerWG.Wait() //wait until attribute families and sellers are not get from mysql //BEGIN TRANSACTION - return nil + tx := *db.Begin() categories, keywords, errCat := getCats(&tx, product.Categories) + return tx.Rollback().Error + if errCat != nil { log.Println("ERR0 Categories" + errCat.Error()) tx.Rollback()