You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
info"Throttling: Limited to #{ThrottleMiddleware::MAX_REQUESTS_PER_HOUR} requests/hour (#{ThrottleMiddleware::MIN_DELAY_SECONDS.round(2)}s min delay)\n"
@@ -200,6 +205,39 @@ def info(message)
200
205
$stdout.printmessage
201
206
end
202
207
208
+
# Helper method to handle 403 errors with retry logic
209
+
defretry_on_403(description,max_retries=3)
210
+
retries=0
211
+
212
+
loopdo
213
+
begin
214
+
returnyield
215
+
rescueOctokit::Forbidden=>e
216
+
retries += 1
217
+
info"⚠️ 403 Forbidden error occurred while #{description}\n"
218
+
219
+
ifretries <= max_retries
220
+
info"🔄 Waiting 5 seconds before retry #{retries}/#{max_retries}...\n"
221
+
sleep(5)
222
+
next
223
+
else
224
+
info"❌ Failed after #{max_retries} retries for #{description}\n"
225
+
print"🤔 Do you want to continue retrying? (Y/N): "
226
+
response=gets.chomp.upcase
227
+
228
+
ifresponse == 'Y'
229
+
info"🔄 Continuing with another #{max_retries} retry attempts...\n"
230
+
retries=0# Reset retry counter
231
+
next
232
+
else
233
+
info"🛑 User chose to exit. Stopping application.\n"
234
+
exit(1)
235
+
end
236
+
end
237
+
end
238
+
end
239
+
end
240
+
203
241
# Helper method to manually paginate requests with proper throttling
0 commit comments