File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ class ComposeGreetingInput:
1313
1414@activity .defn
1515async def compose_greeting (input : ComposeGreetingInput ) -> str :
16- test_service = TestService ()
16+ attempt = activity .info ().attempt - 1
17+ test_service = TestService (attempt = attempt )
1718 # If this raises an exception because it's not done yet, the activity will
1819 # continually be scheduled for retry
1920 return await test_service .get_service_result (input )
Original file line number Diff line number Diff line change 11class TestService :
2- def __init__ (self ):
3- self .try_attempts = 0
4- self .error_attempts = 5
2+ def __init__ (self , attempt = 0 , error_attempts = 5 ):
3+ self .try_attempts = attempt
4+ self .error_attempts = error_attempts
55
66 async def get_service_result (self , input ):
77 print (
You can’t perform that action at this time.
0 commit comments