@@ -220,21 +220,6 @@ async function listAndSortRunners(environment: string) {
220220 } ) ;
221221}
222222
223- /**
224- * We are moving to a new strategy to find and remove runners, this function will ensure
225- * during migration runners tagged in the old way are removed.
226- */
227- function filterLegacyRunners ( ec2runners : RunnerList [ ] ) : RunnerInfo [ ] {
228- return ec2runners
229- . filter ( ( ec2Runner ) => ec2Runner . repo || ec2Runner . org )
230- . map ( ( ec2Runner ) => ( {
231- instanceId : ec2Runner . instanceId ,
232- launchTime : ec2Runner . launchTime ,
233- type : ec2Runner . org ? 'Org' : 'Repo' ,
234- owner : ec2Runner . org ? ( ec2Runner . org as string ) : ( ec2Runner . repo as string ) ,
235- } ) ) ;
236- }
237-
238223function filterRunners ( ec2runners : RunnerList [ ] ) : RunnerInfo [ ] {
239224 return ec2runners . filter ( ( ec2Runner ) => ec2Runner . type ) as RunnerInfo [ ] ;
240225}
@@ -256,12 +241,9 @@ export async function scaleDown(): Promise<void> {
256241 logger . debug ( `No active runners found for environment: '${ environment } '` , LogFields . print ( ) ) ;
257242 return ;
258243 }
259- const legacyRunners = filterLegacyRunners ( ec2Runners ) ;
260- logger . debug ( JSON . stringify ( legacyRunners ) , LogFields . print ( ) ) ;
261- const runners = filterRunners ( ec2Runners ) ;
262244
245+ const runners = filterRunners ( ec2Runners ) ;
263246 await evaluateAndRemoveRunners ( runners , scaleDownConfigs ) ;
264- await evaluateAndRemoveRunners ( legacyRunners , scaleDownConfigs ) ;
265247
266248 const activeEc2RunnersCountAfter = ( await listAndSortRunners ( environment ) ) . length ;
267249 logger . info (
0 commit comments