File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/infra/docs-lambda-index-publisher Expand file tree Collapse file tree 1 file changed +7
-3
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+ // This function should return SQSBatchResponse but for some reason
27+ // it's not working as expected.
28+ // The partial batch response might not be serialized correctly.
29+ // However, serializing the response to JSON and returning it as string works.
30+ static async Task < string > Handler ( SQSEvent ev , ILambdaContext context )
2731{
2832 var s3Client = new AmazonS3Client ( ) ;
2933 var batchItemFailures = new List < SQSBatchResponse . BatchItemFailure > ( ) ;
@@ -83,7 +87,7 @@ static async Task<SQSBatchResponse> Handler(SQSEvent ev, ILambdaContext context)
8387 context . Logger . LogInformation ( $ "Failed to process { batchItemFailures . Count } messages. Returning them to the queue.") ;
8488 context . Logger . LogInformation ( jsonString ) ;
8589 }
86- return response ;
90+ return jsonString ;
8791 }
8892 catch ( Exception ex )
8993 {
@@ -101,7 +105,7 @@ static async Task<SQSBatchResponse> Handler(SQSEvent ev, ILambdaContext context)
101105 } ) . ToList ( ) ) ;
102106 var jsonString = JsonSerializer . Serialize ( response , LinkIndexUpdaterSerializerContext . Default . SQSBatchResponse ) ;
103107 context . Logger . LogInformation ( jsonString ) ;
104- return response ;
108+ return jsonString ;
105109 }
106110}
107111
You can’t perform that action at this time.
0 commit comments