Skip to content

Commit 3617608

Browse files
committed
fix: enhance orphan runner judgment logic for clarity
1 parent c2b1033 commit 3617608

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lambdas/functions/control-plane/src/scale-runners/scale-down.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ async function lastChanceCheckOrphanRunner(runner: RunnerList): Promise<boolean>
230230
logger.debug(
231231
`Runner '${runner.instanceId}' is '${state.status}' and is currently '${state.busy ? 'busy' : 'idle'}'.`,
232232
);
233-
const isOfflineAndBusy = state.status === 'offline' && (state.busy || !state.busy);
234-
if (isOfflineAndBusy) {
233+
const isOfflineAndBusy = state.status === 'offline' && state.busy;
234+
const isOfflineAndIdle = state.status === 'offline' && !state.busy;
235+
if (isOfflineAndBusy || isOfflineAndIdle) {
235236
isOrphan = true;
236237
}
237238
logger.info(`Runner '${runner.instanceId}' is judged to ${isOrphan ? 'be' : 'not be'} orphaned.`);

0 commit comments

Comments
 (0)