@@ -220,21 +220,6 @@ async function listAndSortRunners(environment: string) {
220
220
} ) ;
221
221
}
222
222
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
-
238
223
function filterRunners ( ec2runners : RunnerList [ ] ) : RunnerInfo [ ] {
239
224
return ec2runners . filter ( ( ec2Runner ) => ec2Runner . type ) as RunnerInfo [ ] ;
240
225
}
@@ -256,12 +241,9 @@ export async function scaleDown(): Promise<void> {
256
241
logger . debug ( `No active runners found for environment: '${ environment } '` , LogFields . print ( ) ) ;
257
242
return ;
258
243
}
259
- const legacyRunners = filterLegacyRunners ( ec2Runners ) ;
260
- logger . debug ( JSON . stringify ( legacyRunners ) , LogFields . print ( ) ) ;
261
- const runners = filterRunners ( ec2Runners ) ;
262
244
245
+ const runners = filterRunners ( ec2Runners ) ;
263
246
await evaluateAndRemoveRunners ( runners , scaleDownConfigs ) ;
264
- await evaluateAndRemoveRunners ( legacyRunners , scaleDownConfigs ) ;
265
247
266
248
const activeEc2RunnersCountAfter = ( await listAndSortRunners ( environment ) ) . length ;
267
249
logger . info (
0 commit comments