230
},
231
activitypb.ACTIVITY_EXECUTION_STATUS_FAILED,
232
>
func(a *Activity, ctx chasm.MutableContext, event failedEvent) error {
statemachine.go
233
>
return a.StoreOrSelf(ctx).RecordCompleted(ctx, func(ctx chasm.MutableContext) error {
234
>
req := event.req.GetFailedRequest()
235
>
236
>
if details := req.GetLastHeartbeatDetails(); details != nil {
237
>
heartbeat := a.getOrCreateLastHeartbeat(ctx)
238
>
heartbeat.Details = details
239
>
heartbeat.RecordedTime = timestamppb.New(ctx.Now(a))
240
>
}
241
>
attempt := a.LastAttempt.Get(ctx)
242
>
attempt.LastWorkerIdentity = req.GetIdentity()
243
>
244
>
if err := a.recordFailedAttempt(ctx, 0, activitypb.ACTIVITY_RETRY_INTERVAL_SOURCE_UNSPECIFIED, req.GetFailure(), ctx.Now(a), true); err != nil {
245
return err
246
}
247
249
>
250
>
return nil
251
})
252
},