Skip to content

Commit

Permalink
chore: handle falsy on optional SNS endpoint (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleortega authored Dec 4, 2024
1 parent 2520f32 commit 1832793
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 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,14 @@ export function createDeployerComponent(

const isSnsEventToSend = !!components.sns.eventArn

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 1832793

Please sign in to comment.