-
Notifications
You must be signed in to change notification settings - Fork 39
Description
I ran a GH Action that exceeds its primary rate limit, and the first time (https://github.com/jyasskin/spec-maintenance/actions/runs/6581598228/job/17881791340#check-step-7) plugin-throttling called my onRateLimit
function and retried accordingly, and the second time (https://github.com/jyasskin/spec-maintenance/actions/runs/6581598228/job/17920483150) (on the same commit), it didn't.
It looks like the ones that skip onRateLimit
have a 200 response code, while earlier runs that weren't using plugin-throttling showed a 403 response code for secondary rate limits. (They didn't get far enough to exceed the primary rate limit, so I don't have their response code for that.) Could Bottleneck only be firing the failed
event on HTTP-level failures, and so
plugin-throttling.js/src/wrap-request.ts
Lines 44 to 54 in c4147c9
if ( | |
res.data.errors != null && | |
// @ts-expect-error | |
res.data.errors.some((error) => error.type === "RATE_LIMITED") | |
) { | |
const error = Object.assign(new Error("GraphQL Rate Limit Exceeded"), { | |
response: res, | |
data: res.data, | |
}); | |
throw error; |
onRateLimit
itself?