Ke-vin-S commented on code in PR #8791:
URL:
https://github.com/apache/incubator-devlake/pull/8791#discussion_r3049220188
##########
backend/helpers/pluginhelper/api/graphql_async_client.go:
##########
@@ -218,3 +246,29 @@ func (apiClient *GraphqlAsyncClient) Wait() {
func (apiClient *GraphqlAsyncClient) Release() {
apiClient.cancel()
}
+
+// WithFallbackRateLimit sets the initial/fallback rate limit used when
+// rate limit information cannot be fetched dynamically.
+// This value may be overridden later by getRateRemaining.
+func WithFallbackRateLimit(limit int) GraphqlClientOption {
+ return func(c *GraphqlAsyncClient) {
+ if limit > 0 {
+ c.rateRemaining = limit
+ }
+ }
+}
+
+// resolveRateLimit determines the rate limit for GraphQL requests using task
configuration -> else default constant.
+func resolveRateLimit(taskCtx plugin.TaskContext, logger log.Logger) int {
Review Comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]