Skip to content

Commit 650d10a

Browse files
authored
fix: use "secondary" instead of "abuse" for rate limit (#2266)
1 parent 4346dec commit 650d10a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ The time zone header will determine the timezone used for generating the timesta
275275

276276
`Octokit` implements request throttling using [`@octokit/plugin-throttling`](https://github.com/octokit/plugin-throttling.js/#readme)
277277

278-
By default, requests are retried once and warnings are logged in case hitting a rate or abuse limit
278+
By default, requests are retried once and warnings are logged in case of hitting a rate or secondary rate limit
279279

280280
```js
281281
{
@@ -290,9 +290,9 @@ By default, requests are retried once and warnings are logged in case hitting a
290290
return true;
291291
}
292292
},
293-
onAbuseLimit: (retryAfter, options, octokit) => {
293+
onSecondaryRateLimit: (retryAfter, options, octokit) => {
294294
octokit.log.warn(
295-
`Abuse detected for request ${options.method} ${options.url}`
295+
`SecondaryRateLimit detected for request ${options.method} ${options.url}`
296296
);
297297

298298
if (options.request.retryCount === 0) {

src/octokit.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const Octokit = OctokitCore.plugin(
1515
userAgent: `octokit.js/${VERSION}`,
1616
throttle: {
1717
onRateLimit,
18-
onAbuseLimit,
18+
onSecondaryRateLimit,
1919
},
2020
});
2121

@@ -33,9 +33,9 @@ function onRateLimit(retryAfter: number, options: any, octokit: any) {
3333
}
3434

3535
// istanbul ignore next no need to test internals of the throttle plugin
36-
function onAbuseLimit(retryAfter: number, options: any, octokit: any) {
36+
function onSecondaryRateLimit(retryAfter: number, options: any, octokit: any) {
3737
octokit.log.warn(
38-
`Abuse detected for request ${options.method} ${options.url}`
38+
`SecondaryRateLimit detected for request ${options.method} ${options.url}`
3939
);
4040

4141
if (options.request.retryCount === 0) {

0 commit comments

Comments
 (0)