This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch release-v0.15
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v0.15 by this push:
     new acf37265b fix: correct logging of http async error + improvements to 
scheduler log (#4255) (#4256)
acf37265b is described below

commit acf37265b804438036c385ffc40828da4bc40025
Author: mindlesscloud <[email protected]>
AuthorDate: Sat Jan 28 14:47:15 2023 +0800

    fix: correct logging of http async error + improvements to scheduler log 
(#4255) (#4256)
    
    Co-authored-by: Keon Amini <[email protected]>
---
 plugins/helper/api_async_client.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/plugins/helper/api_async_client.go 
b/plugins/helper/api_async_client.go
index 1d54b8a98..d49dc5912 100644
--- a/plugins/helper/api_async_client.go
+++ b/plugins/helper/api_async_client.go
@@ -100,11 +100,11 @@ func CreateAsyncApiClient(
 
        logger := taskCtx.GetLogger()
        logger.Info(
-               "scheduler for api %s worker: %d, request: %d, duration: %v",
+               "creating scheduler for api \"%s\", number of workers: %d, 
allowed requests (rate-limit): %d, duration of rate-limit: %f minutes",
                apiClient.GetEndpoint(),
                numOfWorkers,
                requests,
-               duration,
+               duration.Minutes(),
        )
        scheduler, err := NewWorkerScheduler(
                taskCtx.GetContext(),
@@ -178,7 +178,9 @@ func (apiClient *ApiAsyncClient) DoAsync(
                        needRetry = true
                } else if res.StatusCode >= HttpMinStatusRetryCode {
                        needRetry = true
-                       err = 
errors.HttpStatus(res.StatusCode).New(fmt.Sprintf("Http DoAsync error: %s", 
body))
+                       err = errors.HttpStatus(res.StatusCode).New(
+                               fmt.Sprintf("Http DoAsync error calling [%s 
%s]. Response: %s", method, path, string(respBody)),
+                       )
                }
 
                //  if it needs retry, check and retry

Reply via email to