Skip to content

Commit

Permalink
chore: set base retry after value to 3s instead of the default of 1s
Browse files Browse the repository at this point in the history
  • Loading branch information
dgellow committed Oct 12, 2023
1 parent 424f543 commit efae8ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ export class GitHub {
auth: options.token,
request: {
agent: this.createDefaultAgent(apiUrl, options.proxy),
retries: options.retries ?? 0,
},
log: {
// octokit debug logs include all requests, too noisy for our debug level
Expand All @@ -328,6 +327,8 @@ export class GitHub {
error: logger.error,
},
retry: {
retries: options.retries ?? 0,
retryAfter: 3, // 3 seconds
doNotRetry: [
'403', // Used by GitHub when throttling
'429', // Too Many Request
Expand All @@ -336,6 +337,8 @@ export class GitHub {
},
throttle: {
enabled: throttlingRetries > 0,
retryAfterBaseValue: 3000, // 3 seconds

onRateLimit: (retryAfter, options, octokit, retryCount) => {
const method =
'method' in options ? options.method : 'UnknownMethod';
Expand Down

0 comments on commit efae8ea

Please sign in to comment.