Skip to content

Commit 1de7c27

Browse files
committed
style: combine two nested ifs
The code: ```typescript if (x) { if (y) { // ... } } ``` is equivalent to ```typescript if (x && y) { // ... } ``` the latter is shorter and easier to read, so let's use that.
1 parent d77d232 commit 1de7c27

File tree

1 file changed

+7
-9
lines changed
  • lambdas/functions/control-plane/src/scale-runners

1 file changed

+7
-9
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,15 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri
277277
const invalidMessages: string[] = [];
278278
for (const payload of payloads) {
279279
const { eventType, messageId, repositoryName, repositoryOwner } = payload;
280-
if (ephemeralEnabled) {
281-
if (eventType !== 'workflow_job') {
282-
logger.warn(
283-
'Event is not supported in combination with ephemeral runners. Please ensure you have enabled workflow_job events.',
284-
{ eventType, messageId },
285-
);
280+
if (ephemeralEnabled && eventType !== 'workflow_job') {
281+
logger.warn(
282+
'Event is not supported in combination with ephemeral runners. Please ensure you have enabled workflow_job events.',
283+
{ eventType, messageId },
284+
);
286285

287-
invalidMessages.push(messageId);
286+
invalidMessages.push(messageId);
288287

289-
continue;
290-
}
288+
continue;
291289
}
292290

293291
if (!isValidRepoOwnerTypeIfOrgLevelEnabled(payload, enableOrgLevel)) {

0 commit comments

Comments
 (0)