You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by zh...@apache.org on 2023/01/28 03:49:13 UTC

[incubator-devlake] branch main updated: fix: correct logging of http async error + improvements to scheduler log (#4255)

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

zhangliang2022 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 7ae851b69 fix: correct logging of http async error + improvements to scheduler log (#4255)
7ae851b69 is described below

commit 7ae851b69afe0cc9b16dc5b05353b298669b6485
Author: Keon Amini <ke...@merico.dev>
AuthorDate: Fri Jan 27 21:49:09 2023 -0600

    fix: correct logging of http async error + improvements to scheduler log (#4255)
---
 backend/helpers/pluginhelper/api/api_async_client.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/backend/helpers/pluginhelper/api/api_async_client.go b/backend/helpers/pluginhelper/api/api_async_client.go
index 653326b80..daead3ee1 100644
--- a/backend/helpers/pluginhelper/api/api_async_client.go
+++ b/backend/helpers/pluginhelper/api/api_async_client.go
@@ -99,11 +99,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(),
@@ -177,7 +177,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