File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/infra/docs-lambda-index-publisher Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,13 @@ static async Task<SQSBatchResponse> Handler(SQSEvent ev, ILambdaContext context)
7676 _ = await s3Client . PutObjectAsync ( putObjectRequest ) ;
7777 context . Logger . LogInformation ( $ "Successfully updated { bucketName } /{ indexFile } .") ;
7878 context . Logger . LogInformation ( $ "Processed { processedMessageCount } messages.") ;
79+ var response = new SQSBatchResponse ( batchItemFailures ) ;
7980 if ( batchItemFailures . Count > 0 )
81+ {
8082 context . Logger . LogInformation ( $ "Failed to process { batchItemFailures . Count } messages. Returning them to the queue.") ;
81- return new SQSBatchResponse ( batchItemFailures ) ;
83+ context . Logger . LogInformation ( JsonSerializer . Serialize ( response , LinkIndexUpdaterSerializerContext . Default . SQSBatchResponse ) ) ;
84+ }
85+ return response ;
8286 }
8387 catch ( Exception ex )
8488 {
@@ -90,10 +94,12 @@ static async Task<SQSBatchResponse> Handler(SQSEvent ev, ILambdaContext context)
9094 context . Logger . LogInformation ( $ "Returning message { m . MessageId } to the queue.") ;
9195 } ) ;
9296
93- return new SQSBatchResponse ( ev . Records . Select ( r => new SQSBatchResponse . BatchItemFailure
97+ var response = new SQSBatchResponse ( ev . Records . Select ( r => new SQSBatchResponse . BatchItemFailure
9498 {
9599 ItemIdentifier = r . MessageId
96100 } ) . ToList ( ) ) ;
101+ context . Logger . LogInformation ( JsonSerializer . Serialize ( response , LinkIndexUpdaterSerializerContext . Default . SQSBatchResponse ) ) ;
102+ return response ;
97103 }
98104}
99105
You can’t perform that action at this time.
0 commit comments