@@ -76,7 +76,7 @@ func (s *Source) processIssuesWithComments(
7676 // request this issue more comments
7777 var commentsQuery singleIssueComments
7878 err := s .connector .GraphQLClient ().Query (ctx , & commentsQuery , commentVars )
79- if s .handleGraphqlRateLimitWithChunkReporter (ctx , reporter , & query .RateLimit , err ) {
79+ if s .handleGraphqlRateLimitWithChunkReporter (ctx , reporter , & commentsQuery .RateLimit , err ) {
8080 continue
8181 }
8282
@@ -167,7 +167,7 @@ func (s *Source) processPRWithComments(ctx context.Context, repoInfo repoInfo, r
167167 }
168168
169169 err := s .connector .GraphQLClient ().Query (ctx , & commentQuery , singlePRVars )
170- if s .handleGraphqlRateLimitWithChunkReporter (ctx , reporter , & query .RateLimit , err ) {
170+ if s .handleGraphqlRateLimitWithChunkReporter (ctx , reporter , & commentQuery .RateLimit , err ) {
171171 continue
172172 }
173173
@@ -288,7 +288,12 @@ func (s *Source) fetchThreadComments(ctx context.Context, threadIDs []string, re
288288 commentsPagination : (* githubv4 .String )(nil ),
289289 }
290290
291- if err := s .connector .GraphQLClient ().Query (ctx , & query , reviewThreadVars ); err != nil {
291+ err := s .connector .GraphQLClient ().Query (ctx , & query , reviewThreadVars )
292+ if s .handleGraphqlRateLimitWithChunkReporter (ctx , reporter , & query .RateLimit , err ) {
293+ continue
294+ }
295+
296+ if err != nil {
292297 return fmt .Errorf ("single-thread query failed: %w" , err )
293298 }
294299
@@ -348,7 +353,6 @@ func (s *Source) handleGraphQLRateLimit(ctx context.Context, rl *rateLimit, errI
348353 }
349354
350355 var retryAfter time.Duration
351- // if rate limit exceeded error happened, wait for 5 minute before trying again
352356 if errIn != nil && strings .Contains (errIn .Error (), "rate limit exceeded" ) {
353357 now := time .Now ()
354358
0 commit comments