File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/infra/docs-lambda-index-publisher Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 2323
2424return ;
2525
26- static async Task < SQSBatchResponse > Handler ( SQSEvent ev , ILambdaContext context )
26+ static async Task < string > Handler ( SQSEvent ev , ILambdaContext context )
2727{
2828 var s3Client = new AmazonS3Client ( ) ;
2929 var batchItemFailures = new List < SQSBatchResponse . BatchItemFailure > ( ) ;
@@ -77,7 +77,7 @@ static async Task<SQSBatchResponse> Handler(SQSEvent ev, ILambdaContext context)
7777 context . Logger . LogInformation ( $ "Processed { processedMessageCount } messages.") ;
7878 if ( batchItemFailures . Count > 0 )
7979 context . Logger . LogInformation ( $ "Failed to process { batchItemFailures . Count } messages. Returning them to the queue.") ;
80- return new SQSBatchResponse ( batchItemFailures ) ;
80+ return JsonSerializer . Serialize ( new SQSBatchResponse ( batchItemFailures ) , LinkIndexUpdaterSerializerContext . Default . SQSBatchResponse ) ;
8181 }
8282 catch ( Exception ex )
8383 {
@@ -88,10 +88,16 @@ static async Task<SQSBatchResponse> Handler(SQSEvent ev, ILambdaContext context)
8888 {
8989 context . Logger . LogInformation ( $ "Returning message { m . MessageId } to the queue.") ;
9090 } ) ;
91- return new SQSBatchResponse ( ev . Records . Select ( r => new SQSBatchResponse . BatchItemFailure
91+
92+ return JsonSerializer . Serialize ( new SQSBatchResponse ( ev . Records . Select ( r => new SQSBatchResponse . BatchItemFailure
9293 {
9394 ItemIdentifier = r . MessageId
94- } ) . ToList ( ) ) ;
95+ } ) . ToList ( ) ) , LinkIndexUpdaterSerializerContext . Default . SQSBatchResponse ) ;
96+ //
97+ // return new SQSBatchResponse(ev.Records.Select(r => new SQSBatchResponse.BatchItemFailure
98+ // {
99+ // ItemIdentifier = r.MessageId
100+ // }).ToList());
95101 }
96102}
97103
You can’t perform that action at this time.
0 commit comments