This repository was archived by the owner on Jan 16, 2025. It is now read-only.
File tree 2 files changed +8
-0
lines changed
modules/runners/lambdas/runners/src/scale-runners
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,9 @@ export type GhRunners = UnboxPromise<ReturnType<Octokit['actions']['listSelfHost
7
7
export class githubCache {
8
8
static clients : Map < string , Octokit > = new Map ( ) ;
9
9
static runners : Map < string , GhRunners > = new Map ( ) ;
10
+
11
+ public static reset ( ) : void {
12
+ githubCache . clients . clear ( ) ;
13
+ githubCache . runners . clear ( ) ;
14
+ }
10
15
}
Original file line number Diff line number Diff line change @@ -57,10 +57,12 @@ async function listGitHubRunners(runner: RunnerInfo): Promise<GhRunners> {
57
57
runner . type === 'Org'
58
58
? await client . paginate ( client . actions . listSelfHostedRunnersForOrg , {
59
59
org : runner . owner ,
60
+ per_page : 100 ,
60
61
} )
61
62
: await client . paginate ( client . actions . listSelfHostedRunnersForRepo , {
62
63
owner : runner . owner . split ( '/' ) [ 0 ] ,
63
64
repo : runner . owner . split ( '/' ) [ 1 ] ,
65
+ per_page : 100 ,
64
66
} ) ;
65
67
githubCache . runners . set ( key , runners ) ;
66
68
@@ -182,6 +184,7 @@ function filterRunners(ec2runners: RunnerList[]): RunnerInfo[] {
182
184
}
183
185
184
186
export async function scaleDown ( ) : Promise < void > {
187
+ githubCache . reset ( ) ;
185
188
const scaleDownConfigs = JSON . parse ( process . env . SCALE_DOWN_CONFIG ) as [ ScalingDownConfig ] ;
186
189
const environment = process . env . ENVIRONMENT ;
187
190
You can’t perform that action at this time.
0 commit comments