From e0e9250b2f8f8d2660b376b25b867181c3673588 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 6 Jan 2020 16:40:32 +0800 Subject: [PATCH] =?UTF-8?q?HTTP=E8=AF=B7=E6=B1=82=E9=83=BD=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E8=AE=BF=E9=97=AE=E8=80=97=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/platformapi.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformapi/platformapi.go b/platformapi/platformapi.go index 37f0c684..060e176d 100644 --- a/platformapi/platformapi.go +++ b/platformapi/platformapi.go @@ -118,7 +118,8 @@ func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http. trackInfo += ", " + utils.GetUUID() baseapi.SugarLogger.Debugf("begin AccessPlatformAPIWithRetry:%s do:%s url:%v, request:%s", trackInfo, request.Method, request.URL, getClonedData(request.URL, savedBuf)) response, err := client.Do(request) - baseapi.SugarLogger.Debugf("end AccessPlatformAPIWithRetry:%s do:%s url:%v", trackInfo, request.Method, request.URL) + usedMilliSecond := time.Now().Sub(beginTime) / time.Millisecond + baseapi.SugarLogger.Debugf("end AccessPlatformAPIWithRetry:%s do:%s url:%v, usedMilliSecond:%d", trackInfo, request.Method, request.URL, usedMilliSecond) if err != nil { baseapi.SugarLogger.Debugf("AccessPlatformAPIWithRetry:%s client.Get return err:%v", trackInfo, err) err, ok := err.(net.Error) @@ -130,7 +131,6 @@ func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http. return ErrAPIAccessFailed } } - usedMilliSecond := time.Now().Sub(beginTime) / time.Millisecond if usedMilliSecond > 5000 { baseapi.SugarLogger.Infof("AccessPlatformAPIWithRetry:%s access api too slow, url:%v, usedMilliSecond:%d", trackInfo, request.URL, usedMilliSecond) }