File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
activities-cancellation-heartbeating/src Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,12 @@ export async function fakeProgress(sleepIntervalMs = 1000): Promise<void> {
77 const startingPoint = activityInfo ( ) . heartbeatDetails || 1 ;
88 log . info ( 'Starting activity at progress' , { startingPoint } ) ;
99 for ( let progress = startingPoint ; progress <= 100 ; ++ progress ) {
10+ // heartbeat immediately after entering loop to retry activity from last failed progress
11+ heartbeat ( progress ) ;
1012 // simple utility to sleep in activity for given interval or throw if Activity is cancelled
1113 // don't confuse with Workflow.sleep which is only used in Workflow functions!
1214 log . info ( 'Progress' , { progress } ) ;
1315 await sleep ( sleepIntervalMs ) ;
14- heartbeat ( progress ) ;
1516 }
1617 } catch ( err ) {
1718 if ( err instanceof CancelledFailure ) {
You can’t perform that action at this time.
0 commit comments