File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ class ComposeGreetingInput:
13
13
14
14
@activity .defn
15
15
async def compose_greeting (input : ComposeGreetingInput ) -> str :
16
- test_service = TestService ()
16
+ attempt = activity .info ().attempt - 1
17
+ test_service = TestService (attempt = attempt )
17
18
# If this raises an exception because it's not done yet, the activity will
18
19
# continually be scheduled for retry
19
20
return await test_service .get_service_result (input )
Original file line number Diff line number Diff line change 1
1
class 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
5
5
6
6
async def get_service_result (self , input ):
7
7
print (
You can’t perform that action at this time.
0 commit comments