Modify Octokit retry options #1768
-
I've a probot up running that listens for new pull requests. When it receives an event it gets the files in the PR to check if any of them match a particular name. 99% of the time it runs fine, but there are some other times that it returns a 404 error, saying that the pull request does not exist. My guess is that there is some kind of eventual consistency issue, where the event is received before the changes are visible everywhere. In order to minimize this issue I was planning to retry on
but I run the same issues as in #1608 and I lose some of the nice things provided by just running with Is there any other way to modify Octokit retry options that doesn't imply using directly |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
when you start probot prorgamatically, you don't start it with And instead of exporting the async function, run the code directly import { Server, Probot, ProbotOctokit } from "probot";
import { default as app } from "./app";
const server = new Server({
Probot: Probot.defaults({
appId: process.env.APP_ID,
privateKey: process.env.PRIVATE_KEY_PATH,
Octokit: ProbotOctokit.defaults({
retry: {
doNotRetry: [400, 401, 403, 422],
},
}),
}),
});
server.load(app).then(() => server.start()) |
Beta Was this translation helpful? Give feedback.
when you start probot prorgamatically, you don't start it with
probot run ./lib/index.js
. Just donode ./lib/index.js
.And instead of exporting the async function, run the code directly