debug
This commit is contained in:
parent
2e8541582d
commit
e5b7a388f5
|
|
@ -87,12 +87,13 @@ func ParseLinkTY(link string,w http.ResponseWriter) {
|
|||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
elapsed := time.Since(start)
|
||||
log.Printf("link parsed at %s", elapsed)
|
||||
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 {
|
||||
helper.Error(err)
|
||||
|
|
@ -117,8 +118,8 @@ func ParseLinkTY(link string,w http.ResponseWriter) {
|
|||
"msg": "Link parsed successfully",
|
||||
"productGroupId": strconv.Itoa(product.ID),
|
||||
})
|
||||
elapsed := time.Since(start)
|
||||
log.Printf("end parse took %s", elapsed)
|
||||
elapsed = time.Since(start)
|
||||
log.Printf("imported at %s", elapsed)
|
||||
return
|
||||
/////////////////////////////////////////
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ func CreateJSONFromModel(model models.TrendyolProductDetailModel) map[string]int
|
|||
var variants []models.Variant
|
||||
|
||||
// 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++ {
|
||||
variant := model.Variants[i]
|
||||
|
|
|
|||
Loading…
Reference in New Issue