@@ -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 { extLogger } from "../common/logging/vscode/loggers" ;
107
118export async function getCodeSearchRepositories (
129 query : string ,
@@ -16,10 +13,9 @@ export async function getCodeSearchRepositories(
1613 } > ,
1714 token : CancellationToken ,
1815 credentials : Credentials ,
19- logger : NotificationLogger ,
2016) : Promise < string [ ] > {
2117 let nwos : string [ ] = [ ] ;
22- const octokit = await provideOctokitWithThrottling ( credentials , logger ) ;
18+ const octokit = await provideOctokitWithThrottling ( credentials ) ;
2319
2420 for await ( const response of octokit . paginate . iterator (
2521 octokit . rest . search . code ,
@@ -47,7 +43,6 @@ export async function getCodeSearchRepositories(
4743
4844async function provideOctokitWithThrottling (
4945 credentials : Credentials ,
50- logger : NotificationLogger ,
5146) : Promise < Octokit > {
5247 const MyOctokit = Octokit . plugin ( throttling ) ;
5348 const auth = await credentials . getAccessToken ( ) ;
@@ -57,16 +52,14 @@ async function provideOctokitWithThrottling(
5752 retry,
5853 throttle : {
5954 onRateLimit : ( retryAfter : number , options : any ) : boolean => {
60- void showAndLogWarningMessage (
61- logger ,
55+ void extLogger . log (
6256 `Rate Limit detected for request ${ options . method } ${ options . url } . Retrying after ${ retryAfter } seconds!` ,
6357 ) ;
6458
6559 return true ;
6660 } ,
6761 onSecondaryRateLimit : ( _retryAfter : number , options : any ) : void => {
68- void showAndLogWarningMessage (
69- logger ,
62+ void extLogger . log (
7063 `Secondary Rate Limit detected for request ${ options . method } ${ options . url } ` ,
7164 ) ;
7265 } ,
0 commit comments