From 30e3c484b4d9fcba5ac45cf0498e9b2fb7a11749 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 6 Aug 2018 11:42:38 +0800 Subject: [PATCH] - change access freshfood timeout to 2 seconds. --- legacy/freshfood/freshfood.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/legacy/freshfood/freshfood.go b/legacy/freshfood/freshfood.go index d8475daf7..004bb2f43 100644 --- a/legacy/freshfood/freshfood.go +++ b/legacy/freshfood/freshfood.go @@ -113,7 +113,7 @@ func init() { } func New(baseURL string) *API { - return &API{baseURL, &http.Client{Timeout: time.Second * 5}} + return &API{baseURL, &http.Client{Timeout: time.Second * 2}} // 2秒超时,因为JD那边的是3秒,超过3秒无意义 } func (f *API) AccessFreshFood(apiStr string, params url.Values) error { @@ -137,7 +137,7 @@ func (f *API) AccessFreshFood(apiStr string, params url.Values) error { } } if err != nil || response.StatusCode != 200 { - globals.SugarLogger.Errorf("AccessFreshFood Call %s error:%v, url:%s, response: %v", fullURL, err, fullURL, response) + globals.SugarLogger.Infof("AccessFreshFood Call %s error:%v, url:%s, response: %v", fullURL, err, fullURL, response) if err != nil { return err }