From 2eed6082760092f8f7e7fcab18d63352d9dd0594 Mon Sep 17 00:00:00 2001 From: lowie27 Date: Fri, 21 Aug 2026 11:58:24 +0200 Subject: [PATCH 1/2] fix(approval-flow): do not skip the polling interval --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 749a0b6..712b1f6 100644 --- a/main.go +++ b/main.go @@ -125,7 +125,7 @@ func newCommentLoopChannel(ctx context.Context, apprv *approvalEnvironment, clie // Loop counter to make an API call only once per 10 interation, intention: avoid github rate limiting and reduce api cost and stress. if loop_ctr < 10 { loop_ctr += 1 - continue + break } loop_ctr = 0 From 716a5351b6bc504d676b7e95d55e9690991553ac Mon Sep 17 00:00:00 2001 From: Sunny <55059942+snskArora@users.noreply.github.com> Date: Fri, 28 Aug 2026 19:40:57 +0530 Subject: [PATCH 2/2] Enhance comments for API call throttling logic Added comments to clarify throttling logic for API calls and control flow in the loop. --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 712b1f6..7b0f3a9 100644 --- a/main.go +++ b/main.go @@ -123,6 +123,9 @@ func newCommentLoopChannel(ctx context.Context, apprv *approvalEnvironment, clie case approvalStatusPending: if apprv.closeIssueMeansDenial { // Loop counter to make an API call only once per 10 interation, intention: avoid github rate limiting and reduce api cost and stress. + // Throttle the issue-state check: Issues.Get runs once every 11 iterations to avoid GitHub rate limiting. + // + // This break exits the enclosing switch, NOT the for loop, so control falls through to the time.Sleep below and polling continues at the normal interval. Do not change it back to continue: continue is not captured by a switch, so it would jump straight to the next for iteration, skip the sleep, and issue 12 API calls per polling interval (see #235). if loop_ctr < 10 { loop_ctr += 1 break