@@ -51,8 +51,8 @@ async function listGitHubRunners(runner: RunnerInfo): Promise<GhRunners> {
51
51
return cachedRunners ;
52
52
}
53
53
54
- const client = await getOrCreateOctokit ( runner ) ;
55
54
console . debug ( `[listGithubRunners] Cache miss for ${ key } ` ) ;
55
+ const client = await getOrCreateOctokit ( runner ) ;
56
56
const runners =
57
57
runner . type === 'Org'
58
58
? await client . paginate ( client . actions . listSelfHostedRunnersForOrg , {
@@ -104,7 +104,7 @@ async function removeRunner(ec2runner: RunnerInfo, ghRunnerId: number): Promise<
104
104
console . error ( `Failed to de-register GitHub runner: ${ result . status } ` ) ;
105
105
}
106
106
} catch ( e ) {
107
- console . debug ( `Runner '${ ec2runner . instanceId } ' cannot be de-registered, most likely the runner is active.` ) ;
107
+ console . info ( `Runner '${ ec2runner . instanceId } ' cannot be de-registered, most likely the runner is active.` ) ;
108
108
}
109
109
}
110
110
@@ -117,23 +117,23 @@ async function evaluateAndRemoveRunners(
117
117
118
118
for ( const ownerTag of ownerTags ) {
119
119
const ec2RunnersFiltered = ec2Runners . filter ( ( runner ) => runner . owner === ownerTag ) ;
120
- console . debug ( `Found: '${ ec2RunnersFiltered . length } ' active GitHub runners with owner tag: '${ ownerTag } '` ) ;
120
+ console . info ( `Found: '${ ec2RunnersFiltered . length } ' active GitHub runners with owner tag: '${ ownerTag } '` ) ;
121
121
for ( const ec2Runner of ec2RunnersFiltered ) {
122
122
const ghRunners = await listGitHubRunners ( ec2Runner ) ;
123
123
const ghRunner = ghRunners . find ( ( runner ) => runner . name === ec2Runner . instanceId ) ;
124
124
if ( ghRunner ) {
125
125
if ( runnerMinimumTimeExceeded ( ec2Runner ) ) {
126
126
if ( idleCounter > 0 ) {
127
127
idleCounter -- ;
128
- console . debug ( `Runner '${ ec2Runner . instanceId } ' will kept idle.` ) ;
128
+ console . info ( `Runner '${ ec2Runner . instanceId } ' will kept idle.` ) ;
129
129
} else {
130
- console . debug ( `Runner '${ ec2Runner . instanceId } ' will be terminated.` ) ;
130
+ console . info ( `Runner '${ ec2Runner . instanceId } ' will be terminated.` ) ;
131
131
await removeRunner ( ec2Runner , ghRunner . id ) ;
132
132
}
133
133
}
134
134
} else {
135
135
if ( bootTimeExceeded ( ec2Runner ) ) {
136
- console . debug ( `Runner '${ ec2Runner . instanceId } ' is orphaned and will be removed.` ) ;
136
+ console . info ( `Runner '${ ec2Runner . instanceId } ' is orphaned and will be removed.` ) ;
137
137
terminateOrphan ( ec2Runner . instanceId ) ;
138
138
} else {
139
139
console . debug ( `Runner ${ ec2Runner . instanceId } has not yet booted.` ) ;
0 commit comments