File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/infra/docs-lambda-index-publisher Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 2323
2424return ;
2525
26- static async Task < string > Handler ( SQSEvent ev , ILambdaContext context )
26+ static async Task < SQSBatchResponse > Handler ( SQSEvent ev , ILambdaContext context )
2727{
2828 var s3Client = new AmazonS3Client ( ) ;
2929 var batchItemFailures = new List < SQSBatchResponse . BatchItemFailure > ( ) ;
@@ -78,7 +78,7 @@ static async Task<string> Handler(SQSEvent ev, ILambdaContext context)
7878 context . Logger . LogInformation ( $ "Processed { processedMessageCount } messages.") ;
7979 if ( batchItemFailures . Count > 0 )
8080 context . Logger . LogInformation ( $ "Failed to process { batchItemFailures . Count } messages. Returning them to the queue.") ;
81- return JsonSerializer . Serialize ( new SQSBatchResponse ( batchItemFailures ) , LinkIndexUpdaterSerializerContext . Default . SQSBatchResponse ) ;
81+ return new SQSBatchResponse ( batchItemFailures ) ;
8282 }
8383 catch ( Exception ex )
8484 {
@@ -90,15 +90,10 @@ static async Task<string> Handler(SQSEvent ev, ILambdaContext context)
9090 context . Logger . LogInformation ( $ "Returning message { m . MessageId } to the queue.") ;
9191 } ) ;
9292
93- return JsonSerializer . Serialize ( new SQSBatchResponse ( ev . Records . Select ( r => new SQSBatchResponse . BatchItemFailure
93+ return new SQSBatchResponse ( ev . Records . Select ( r => new SQSBatchResponse . BatchItemFailure
9494 {
9595 ItemIdentifier = r . MessageId
96- } ) . ToList ( ) ) , LinkIndexUpdaterSerializerContext . Default . SQSBatchResponse ) ;
97- //
98- // return new SQSBatchResponse(ev.Records.Select(r => new SQSBatchResponse.BatchItemFailure
99- // {
100- // ItemIdentifier = r.MessageId
101- // }).ToList());
96+ } ) . ToList ( ) ) ;
10297 }
10398}
10499
You can’t perform that action at this time.
0 commit comments