Skip to content

Commit 013a691

Browse files
committed
Use showAndLogWarning to surface rateLimit
1 parent 99891be commit 013a691

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

extensions/ql-vscode/src/variant-analysis/gh-api/gh-api-client.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,15 @@ export async function getCodeSearchRepositories(
2828
const octokit = new MyOctokit({
2929
auth,
3030
throttle: {
31-
onRateLimit: (
32-
retryAfter: number,
33-
options: any,
34-
octokit: Octokit,
35-
): boolean => {
36-
octokit.log.warn(
31+
onRateLimit: (retryAfter: number, options: any): boolean => {
32+
void showAndLogWarningMessage(
3733
`Request quota exhausted for request ${options.method} ${options.url}. Retrying after ${retryAfter} seconds!`,
3834
);
3935

4036
return true;
4137
},
42-
onSecondaryRateLimit: (
43-
_retryAfter: number,
44-
options: any,
45-
octokit: Octokit,
46-
): void => {
47-
octokit.log.warn(
38+
onSecondaryRateLimit: (_retryAfter: number, options: any): void => {
39+
void showAndLogWarningMessage(
4840
`SecondaryRateLimit detected for request ${options.method} ${options.url}`,
4941
);
5042
},

0 commit comments

Comments
 (0)