@@ -3,7 +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 { extLogger } from "../common/logging/vscode/loggers " ;
6+ import { BaseLogger } from "../common/logging" ;
77
88export async function getCodeSearchRepositories (
99 query : string ,
@@ -13,9 +13,10 @@ export async function getCodeSearchRepositories(
1313 } > ,
1414 token : CancellationToken ,
1515 credentials : Credentials ,
16+ logger : BaseLogger ,
1617) : Promise < string [ ] > {
1718 let nwos : string [ ] = [ ] ;
18- const octokit = await provideOctokitWithThrottling ( credentials ) ;
19+ const octokit = await provideOctokitWithThrottling ( credentials , logger ) ;
1920
2021 for await ( const response of octokit . paginate . iterator (
2122 octokit . rest . search . code ,
@@ -43,6 +44,7 @@ export async function getCodeSearchRepositories(
4344
4445async function provideOctokitWithThrottling (
4546 credentials : Credentials ,
47+ logger : BaseLogger ,
4648) : Promise < Octokit > {
4749 const MyOctokit = Octokit . plugin ( throttling ) ;
4850 const auth = await credentials . getAccessToken ( ) ;
@@ -52,14 +54,14 @@ async function provideOctokitWithThrottling(
5254 retry,
5355 throttle : {
5456 onRateLimit : ( retryAfter : number , options : any ) : boolean => {
55- void extLogger . log (
57+ void logger . log (
5658 `Rate Limit detected for request ${ options . method } ${ options . url } . Retrying after ${ retryAfter } seconds!` ,
5759 ) ;
5860
5961 return true ;
6062 } ,
6163 onSecondaryRateLimit : ( _retryAfter : number , options : any ) : void => {
62- void extLogger . log (
64+ void logger . log (
6365 `Secondary Rate Limit detected for request ${ options . method } ${ options . url } ` ,
6466 ) ;
6567 } ,
0 commit comments