Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): background PR sync reads summaries in batches #13198

Mergedjuliusmarmingemerged 2 commits intoaudit-github-rate-limit-usage fromrefs/pull/13198/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 107 additions and 46 deletions (loading 3).

x
0 of 5 viewed, 5 left
3 additions and 1 deletionapps/server/src/orchestration/PullRequestSyncReactor.tsModified
View file
@@ -303,7 +303,9 @@
Effect.catchCause(logSkipped("pull request sync skipped", { key })),
: Effect.void,
- { concurrency: 8, discard: true },
+ // As wide as one batched summary read, so the sweep's reads on a host arrive together and
+ // GitHub answers them in one request rather than one `gh pr view` apiece.
+ { concurrency: 25, discard: true },
});
​
104 additions and 45 deletionsapps/server/src/pullRequest/GitHubPullRequestCli.test.tsModified
View file
@@ -452,77 +452,137 @@
}),
​
- it.effect("reads linked pull request status with the overview fields in one request", () =>
+ it.effect("reads linked pull requests on one host together, filed back by position", () =>
Effect.gen(function* () {
+ const node = (number: number) => ({
+ number,
+ title: `Pull request ${number}`,
+ url: `https://github.com/acme/web/pull/${number}`,
+ author: { __typename: "User", login: "octocat", name: "Octo Cat", avatarUrl: null },
+ baseRefName: "main",
+ headRefName: `feat/${number}`,
+ state: "OPEN",