@@ -95,7 +95,6 @@ export async function enqueueLetterUpdateRequests(
9595 updateLetterCommands : UpdateLetterCommand [ ] ,
9696 correlationId : string ,
9797 deps : Deps ,
98- statusesMapping ?: Map < string , number > ,
9998) {
10099 const BATCH_SIZE = 10 ; // SQS SendMessageBatch max
101100 const CONCURRENCY = 5 ; // number of parallel batch API calls
@@ -109,21 +108,13 @@ export async function enqueueLetterUpdateRequests(
109108
110109 await Promise . all (
111110 window . map ( async ( batch , batchIdx ) => {
112- const entries = batch . map ( ( request , idx ) => {
113- if ( statusesMapping ) {
114- statusesMapping . set (
115- request . status ,
116- ( statusesMapping . get ( request . status ) || 0 ) + 1 ,
117- ) ;
118- }
119- return {
120- Id : `${ i + batchIdx } -${ idx } ` , // unique per batch entry
121- MessageBody : JSON . stringify ( request ) ,
122- MessageAttributes : {
123- CorrelationId : { DataType : "String" , StringValue : correlationId } ,
124- } ,
125- } ;
126- } ) ;
111+ const entries = batch . map ( ( request , idx ) => ( {
112+ Id : `${ i + batchIdx } -${ idx } ` , // unique per batch entry
113+ MessageBody : JSON . stringify ( request ) ,
114+ MessageAttributes : {
115+ CorrelationId : { DataType : "String" , StringValue : correlationId } ,
116+ } ,
117+ } ) ) ;
127118
128119 const cmd = new SendMessageBatchCommand ( {
129120 QueueUrl : deps . env . QUEUE_URL ,
0 commit comments