575
},
576
activitypb.ACTIVITY_EXECUTION_STATUS_SCHEDULED,
577
>
func(a *Activity, ctx chasm.MutableContext, event rescheduleEvent) error {
statemachine.go
578
>
attempt := a.LastAttempt.Get(ctx)
579
>
currentTime := ctx.Now(a)
580
>
581
>
a.ResetKeepPaused = false
582
>
a.applyDeferredOptionRestore(ctx)
583
>
a.clearHeartbeatDetails(ctx)
584
>
585
>
attempt.Count = 1
586
>
attempt.Stamp++
587
>
588
>
if err := a.recordFailedAttempt(ctx, event.retryInterval, event.retryIntervalSource, event.failure, currentTime, false); err != nil {
589
return err
590
}
591
// Reset discards the retry backoff
593
>
attempt.CurrentRetryIntervalSource = activitypb.ACTIVITY_RETRY_INTERVAL_SOURCE_UNSPECIFIED
594
>
595
>
dispatchTime := a.dispatchTimeRespectingStartDelay(currentTime)
596
>
attempt.DispatchTime = timestamppb.New(dispatchTime)
597
>
if timeout := a.GetScheduleToStartTimeout().AsDuration(); timeout > 0 {
598
ctx.AddTask(
599
a,