Skip to content

Commit d04095c

Browse files
evangraykfacebook-github-bot
authored andcommitted
Add default timeout to gh queries
Summary: Add more timeouts to other gh queries. I wouldn't expect these queries to take more than a few seconds. If they are, something is wrong. This also means we have a cap on how many processes we'll have going at the same time. Reviewed By: muirdm Differential Revision: D76072068 fbshipit-source-id: d1ff8ed1576110a430abc25c71ea8a6f87bca96e
1 parent 02681a6 commit d04095c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

addons/isl-server/src/github/githubCodeReviewProvider.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export type GitHubDiffSummary = {
6262
branchName?: string;
6363
};
6464

65+
const DEFAULT_GH_FETCH_TIMEOUT = 60_000; // 1 minute
66+
6567
type GitHubCodeReviewSystem = CodeReviewSystem & {type: 'github'};
6668
export class GitHubCodeReviewProvider implements CodeReviewProvider {
6769
constructor(private codeReviewSystem: GitHubCodeReviewSystem, private logger: Logger) {}
@@ -234,7 +236,12 @@ export class GitHubCodeReviewProvider implements CodeReviewProvider {
234236
}
235237

236238
private query<D, V>(query: string, variables: V, timeoutMs?: number): Promise<D | undefined> {
237-
return queryGraphQL<D, V>(query, variables, this.codeReviewSystem.hostname, timeoutMs);
239+
return queryGraphQL<D, V>(
240+
query,
241+
variables,
242+
this.codeReviewSystem.hostname,
243+
timeoutMs ?? DEFAULT_GH_FETCH_TIMEOUT,
244+
);
238245
}
239246

240247
public dispose() {

0 commit comments

Comments
 (0)