File tree Expand file tree Collapse file tree
infrastructure/modules/eventpub/lambda/eventpub/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ function validateEvent(event) {
5050}
5151
5252async function sendToEventBridge ( events , eventBusArn ) {
53- console . debug ( `Sending ${ events . length } events to EventBridge: ${ eventBusArn } ` ) ;
53+ const failedEvents = [ ] ;
5454
55- const failedEvents = [ ] ;
56- for ( let i = 0 ; i < events . length ; i += EVENTBRIDGE_MAX_BATCH_SIZE ) {
55+ for ( let i = 0 ; i < events . length ; i += EVENTBRIDGE_MAX_BATCH_SIZE ) {
56+ console . debug ( `Sending ${ events . length } events to EventBridge: ${ eventBusArn } ` ) ;
5757 const batch = events . slice ( i , i + EVENTBRIDGE_MAX_BATCH_SIZE ) ;
5858 const entries = batch . map ( event => ( {
5959 Source : 'custom.event' ,
@@ -93,9 +93,8 @@ async function sendToEventBridge(events, eventBusArn) {
9393}
9494
9595async function sendToDLQ ( events ) {
96- console . warn ( `Sending ${ events . length } failed events to DLQ` ) ;
97-
98- for ( const event of events ) {
96+ for ( const event of events ) {
97+ console . warn ( `Sending ${ events . length } failed events to DLQ` ) ;
9998 await sqs . send ( new SendMessageCommand ( { QueueUrl : DLQ_URL , MessageBody : JSON . stringify ( event ) } ) ) ;
10099 }
101100}
You can’t perform that action at this time.
0 commit comments