Skip to content

Commit 0046b7f

Browse files
committed
Add more robust check to idempotency
1 parent da54341 commit 0046b7f

File tree

1 file changed

+1
-1
lines changed
  • aws_lambda_powertools/utilities/idempotency

1 file changed

+1
-1
lines changed

aws_lambda_powertools/utilities/idempotency/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def _process_idempotency(self, is_replay: bool):
167167
# We give preference to ReturnValuesOnConditionCheckFailure because it is a faster and more cost-effective
168168
# way of retrieving the existing record after a failed conditional write operation.
169169
record = exc.old_data_record or self._get_idempotency_record()
170-
if is_replay:
170+
if is_replay and record is not None and record.status == "INPROGRESS":
171171
return self._get_function_response()
172172
# If a record is found, handle it for status
173173
if record:

0 commit comments

Comments
 (0)