This commit is contained in:
merdan 2023-07-18 12:11:52 +05:00
parent 2e8541582d
commit e5b7a388f5
2 changed files with 7 additions and 6 deletions

View File

@ -87,12 +87,13 @@ func ParseLinkTY(link string,w http.ResponseWriter) {
fmt.Println(err) fmt.Println(err)
return return
} }
elapsed := time.Since(start)
log.Printf("link parsed at %s", elapsed)
jsonProduct, err := linkParser.GetProductDetailWithOptions(product.ID, product.ProductGroupID) jsonProduct, err := linkParser.GetProductDetailWithOptions(product.ID, product.ProductGroupID)
jsProd,_:= json.MarshalIndent(jsonProduct,""," ") elapsed = time.Since(start)
log.Printf("product gat at %s", elapsed)
fmt.Println(string(jsProd))
if err != nil { if err != nil {
helper.Error(err) helper.Error(err)
@ -117,8 +118,8 @@ func ParseLinkTY(link string,w http.ResponseWriter) {
"msg": "Link parsed successfully", "msg": "Link parsed successfully",
"productGroupId": strconv.Itoa(product.ID), "productGroupId": strconv.Itoa(product.ID),
}) })
elapsed := time.Since(start) elapsed = time.Since(start)
log.Printf("end parse took %s", elapsed) log.Printf("imported at %s", elapsed)
return return
///////////////////////////////////////// /////////////////////////////////////////

View File

@ -266,7 +266,7 @@ func CreateJSONFromModel(model models.TrendyolProductDetailModel) map[string]int
var variants []models.Variant var variants []models.Variant
// if show variants, then it is configurable product. // if show variants, then it is configurable product.
if model.ShowVariants { if model.ShowVariants && len(model.Variants) != 0 {
for i := 0; i < len(model.Variants); i++ { for i := 0; i < len(model.Variants); i++ {
variant := model.Variants[i] variant := model.Variants[i]