Skip to content

Commit 975933d

Browse files
committed
chores(documentation): update sample code for expires_in_progress
1 parent a4f8ce7 commit 975933d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/utilities/idempotency.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,14 +884,18 @@ To activate this behaviour, enable the `expires_in_progress` option on the confi
884884

885885
=== "app.py"
886886

887-
```python hl_lines="7"
887+
```python hl_lines="8"
888888
from aws_lambda_powertools.utilities.idempotency import (
889-
DynamoDBPersistenceLayer, idempotent
889+
DynamoDBPersistenceLayer, IdempotencyConfig, idempotent
890890
)
891891

892892
persistence_layer = DynamoDBPersistenceLayer(table_name="IdempotencyTable")
893893

894-
@idempotent(persistence_store=persistence_layer, expires_in_progress=True)
894+
config = IdempotencyConfig(
895+
expires_in_progress=True,
896+
)
897+
898+
@idempotent(persistence_store=persistence_layer, config=config)
895899
def handler(event, context):
896900
payment = create_subscription_payment(
897901
user=event['user'],

0 commit comments

Comments
 (0)