64
nextScheduledTime *timestamppb.Timestamp,
65
isActivityRetryStampIncrementEnabled bool,
67
>
previousAttempt := ai.Attempt
68
>
ai.Attempt = attempt
69
>
ai.Version = version
70
>
ai.ScheduledTime = nextScheduledTime
71
>
ClearActivityStartedState(ai)
72
>
// Mark per-attempt timers for recreation.
73
>
ai.TimerTaskStatus &^= TimerTaskStatusCreatedHeartbeat | TimerTaskStatusCreatedStartToClose | TimerTaskStatusCreatedScheduleToStart
74
>
ai.RetryLastWorkerIdentity = ai.StartedIdentity
75
>
ai.RetryLastFailure = failure
76
>
// this flag means the user resets the activity with "--reset-heartbeat" flag
77
>
// server sends heartbeat details to the worker with the new activity attempt
78
>
// if the current attempt was still running - worker can still send new heartbeats, and even complete the activity
79
>
// so for the current activity attempt server continue to accept the heartbeats, but reset it for the new attempt
80
>
if ai.ResetHeartbeats {
81
ai.LastHeartbeatDetails = nil
82
ai.LastHeartbeatUpdateTime = nil
83
}
85
>
ai.ResetHeartbeats = false
86
>
87
>
if isActivityRetryStampIncrementEnabled && attempt > previousAttempt {
88
ai.Stamp++
89
}