Skip to content

Commit 9121468

Browse files
committed
ok
1 parent b239b2b commit 9121468

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/infra/docs-lambda-index-publisher/Program.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323

2424
return;
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

0 commit comments

Comments
 (0)