Skip to content

Commit

Permalink
chore: handle falsy on optional SNS endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aleortega committed Dec 4, 2024
1 parent 2520f32 commit a503ec8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/adapters/deployer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function createDeployerComponent(
const logger = components.logs.getLogger('downloader')

const client = new SNSClient({
endpoint: components.sns.optionalSnsEndpoint
endpoint: components.sns.optionalSnsEndpoint ? components.sns.optionalSnsEndpoint : undefined
})

return {
Expand All @@ -26,6 +26,15 @@ export function createDeployerComponent(

const isSnsEventToSend = !!components.sns.eventArn


Check failure on line 29 in src/adapters/deployer/index.ts

View workflow job for this annotation

GitHub Actions / build / validations

Delete `⏎`

Check failure on line 29 in src/adapters/deployer/index.ts

View workflow job for this annotation

GitHub Actions / build / validations

Delete `⏎`
logger.debug('Handling entity', {
entityId: entity.entityId,
entityType: entity.entityType,
exists: exists ? 'true' : 'false',
isSnsEntityToSend: isSnsEntityToSend ? 'true' : 'false',
isSnsEventToSend: isSnsEventToSend ? 'true' : 'false'
})

if (exists || !(isSnsEntityToSend && isSnsEventToSend)) {
return await markAsDeployed()
}
Expand Down

0 comments on commit a503ec8

Please sign in to comment.