217
[]enumsspb.CallbackState{enumsspb.CALLBACK_STATE_SCHEDULED},
218
enumsspb.CALLBACK_STATE_BACKING_OFF,
219
>
func(cb Callback, event EventAttemptFailed) (hsm.TransitionOutput, error) {
statemachine.go
220
>
cb.recordAttempt(event.Time)
221
>
// Use 0 for elapsed time as we don't limit the retry by time (for now).
222
>
nextDelay := event.RetryPolicy.ComputeNextDelay(0, int(cb.Attempt), event.Err)
223
>
nextAttemptScheduleTime := event.Time.Add(nextDelay)
224
>
cb.CallbackInfo.NextAttemptScheduleTime = timestamppb.New(nextAttemptScheduleTime)
225
>
cb.CallbackInfo.LastAttemptFailure = &failurepb.Failure{
226
>
Message: event.Err.Error(),
227
>
FailureInfo: &failurepb.Failure_ApplicationFailureInfo{
228
>
ApplicationFailureInfo: &failurepb.ApplicationFailureInfo{
229
>
NonRetryable: false,
230
>
},
231
>
},
232
>
}
233
>
return cb.output()
234
>
},
235
)
236