@@ -121,7 +121,7 @@ def handler(event: dict, context: DurableContext) -> str:
121121
122122 if amount > 1000 :
123123 context.step(lambda _ : " Manager approval required" , name = " approval" )
124- context.wait(seconds = 10 , name = " approval_wait" )
124+ context.wait(Duration.from_seconds( 10 ) , name = " approval_wait" )
125125 result = context.step(lambda _ : " High-value order processed" , name = " process_high" )
126126 else :
127127 result = context.step(lambda _ : " Standard order processed" , name = " process_standard" )
@@ -514,7 +514,7 @@ For workflows with long waits, verify configuration without actually waiting:
514514@durable_execution
515515def handler (event : dict , context : DurableContext) -> str :
516516 context.step(lambda _ : " Starting" , name = " start" )
517- context.wait(seconds = 3600 , name = " long_wait" ) # 1 hour
517+ context.wait(Duration.from_seconds( 3600 ) , name = " long_wait" ) # 1 hour
518518 context.step(lambda _ : " Continuing" , name = " continue" )
519519 return " Complete"
520520```
@@ -559,7 +559,7 @@ def handler(event: dict, context: DurableContext) -> int:
559559 if state >= 3 :
560560 break
561561
562- context.wait(seconds = 1 , name = f " wait_ { attempt} " )
562+ context.wait(Duration.from_seconds( 1 ) , name = f " wait_ { attempt} " )
563563
564564 return state
565565```
@@ -604,7 +604,7 @@ def handler(event: dict, context: DurableContext) -> dict:
604604 state = context.step(lambda _ , s = state: s + 1 , name = f " attempt_ { attempt} " )
605605
606606 if state < target:
607- context.wait(seconds = 1 , name = f " wait_ { attempt} " )
607+ context.wait(Duration.from_seconds( 1 ) , name = f " wait_ { attempt} " )
608608
609609 return {" state" : state, " attempts" : attempt, " reached_target" : state >= target}
610610```
0 commit comments