@@ -3,10 +3,7 @@ import { throttling } from "@octokit/plugin-throttling";
33import { Octokit } from "@octokit/rest" ;
44import { Progress , CancellationToken } from "vscode" ;
55import { Credentials } from "../common/authentication" ;
6- import {
7- NotificationLogger ,
8- showAndLogWarningMessage ,
9- } from "../common/logging" ;
6+ import { BaseLogger } from "../common/logging" ;
107
118export async function getCodeSearchRepositories (
129 query : string ,
@@ -16,7 +13,7 @@ export async function getCodeSearchRepositories(
1613 } > ,
1714 token : CancellationToken ,
1815 credentials : Credentials ,
19- logger : NotificationLogger ,
16+ logger : BaseLogger ,
2017) : Promise < string [ ] > {
2118 let nwos : string [ ] = [ ] ;
2219 const octokit = await provideOctokitWithThrottling ( credentials , logger ) ;
@@ -47,7 +44,7 @@ export async function getCodeSearchRepositories(
4744
4845async function provideOctokitWithThrottling (
4946 credentials : Credentials ,
50- logger : NotificationLogger ,
47+ logger : BaseLogger ,
5148) : Promise < Octokit > {
5249 const MyOctokit = Octokit . plugin ( throttling ) ;
5350 const auth = await credentials . getAccessToken ( ) ;
@@ -57,16 +54,14 @@ async function provideOctokitWithThrottling(
5754 retry,
5855 throttle : {
5956 onRateLimit : ( retryAfter : number , options : any ) : boolean => {
60- void showAndLogWarningMessage (
61- logger ,
57+ void logger . log (
6258 `Rate Limit detected for request ${ options . method } ${ options . url } . Retrying after ${ retryAfter } seconds!` ,
6359 ) ;
6460
6561 return true ;
6662 } ,
6763 onSecondaryRateLimit : ( _retryAfter : number , options : any ) : void => {
68- void showAndLogWarningMessage (
69- logger ,
64+ void logger . log (
7065 `Secondary Rate Limit detected for request ${ options . method } ${ options . url } ` ,
7166 ) ;
7267 } ,
0 commit comments