Skip to content

Commit 979c293

Browse files
committed
debug
1 parent b7373b6 commit 979c293

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)