Skip to content

Commit

Permalink
fix(idempotency): PR feedback on config and kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
heitorlessa committed Mar 5, 2021
1 parent 9763bbe commit ae89970
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aws_lambda_powertools/utilities/idempotency/idempotency.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ def idempotent(
>>> return {"StatusCode": 200}
"""

idempotency_handler = IdempotencyHandler(handler, event, context, config or IdempotencyConfig(), persistence_store)
config = config or IdempotencyConfig()
idempotency_handler = IdempotencyHandler(
lambda_handler=handler, event=event, context=context, persistence_store=persistence_store, config=config
)

# IdempotencyInconsistentStateError can happen under rare but expected cases when persistent state changes in the
# small time between put & get requests. In most cases we can retry successfully on this exception.
# Maintenance: Allow customers to specify number of retries
max_handler_retries = 2
for i in range(max_handler_retries + 1):
try:
Expand Down

0 comments on commit ae89970

Please sign in to comment.