118
},
119
nexusoperationpb.OPERATION_STATUS_STARTED,
121
>
startTime := ctx.Now(o)
122
>
if event.StartTime != nil {
123
startTime = *event.StartTime
124
}
125
127
>
// Also consider this the completion of an attempt even if the task's saveResult call lost the race with
128
>
// the async completion.
129
>
o.LastAttemptCompleteTime = o.StartedTime
130
>
o.LastAttemptFailure = nil
131
>
// Clear the next attempt schedule time when leaving BACKING_OFF state.
132
>
// This field is only valid in BACKING_OFF state.
133
>
o.NextAttemptScheduleTime = nil
134
>
135
>
// Store the operation token for async completion.
136
>
o.OperationToken = event.OperationToken
137
>
138
>
// Emit schedule-to-start latency
139
>
metricsHandler := o.metricsHandler(ctx)
140
>
NexusOperationScheduleToStartLatency.With(metricsHandler).Record(startTime.Sub(o.GetScheduledTime().AsTime()))
141
>
142
>
// Emit a start-to-close timeout task if configured.
143
>
if o.StartToCloseTimeout != nil && o.StartToCloseTimeout.AsDuration() != 0 {
144
deadline := startTime.Add(o.StartToCloseTimeout.AsDuration())
145
ctx.AddTask(o, chasm.TaskAttributes{