From 313b33f23863b266a61e619c8b7d56a46b611b15 Mon Sep 17 00:00:00 2001 From: merdan Date: Thu, 19 Jan 2023 16:59:50 +0500 Subject: [PATCH] wishlist fix --- gorm_models/product.go | 3 ++- pkg/request.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gorm_models/product.go b/gorm_models/product.go index a2060cc..8b60494 100644 --- a/gorm_models/product.go +++ b/gorm_models/product.go @@ -112,7 +112,8 @@ func DeleteProducts(db *gorm.DB) error { "LEFT JOIN order_items oi ON p.id = oi.product_id " + "LEFT JOIN order_items op ON p.id = op.parent_id " + "LEFT JOIN wishlist wp ON p.id = wp.product_id " + - "WHERE oi.id IS NULL AND op.id IS NULL AND wp.id IS NULL AND p.id IN (SELECT product_id from marketplace_products where marketplace_seller_id=1);" + "JOIN marketplace_products mp ON p.id = mp.product_id "+ + "WHERE oi.id IS NULL AND op.id IS NULL AND wp.id IS NULL AND mp.marketplace_seller_id=1;" db.WithContext(ctx).Exec(qb) db.WithContext(ctx).Exec("UPDATE product_flat set sku=concat(id,\"-ordered\"), status=0 where status=1 AND product_id IN (SELECT product_id from marketplace_products where marketplace_seller_id=1)" ) db.WithContext(ctx).Exec("UPDATE products set sku=concat(id,\"-ordered\") WHERE id IN (SELECT product_id from marketplace_products where marketplace_seller_id=1)") diff --git a/pkg/request.go b/pkg/request.go index 43bf74f..dc6bd75 100644 --- a/pkg/request.go +++ b/pkg/request.go @@ -12,8 +12,8 @@ import ( func SendRequest(method string, endpoint string, values []byte, authKey string) ([]byte, error) { - const ConnectMaxWaitTime = 30 * time.Second - const RequestMaxWaitTime = 60 * time.Second + const ConnectMaxWaitTime = time.Minute + const RequestMaxWaitTime = 5 * time.Minute client := http.Client{ Transport: &http.Transport{