226
}
227
229
>
referenceTime := t.Now()
230
>
updateMutableState := false
231
>
scheduleWorkflowTask := false
232
>
233
>
// Need to clear activity heartbeat timer task mask for new activity timer task creation.
234
>
// NOTE: LastHeartbeatTimeoutVisibilityInSeconds is for deduping heartbeat timer creation as it's possible
235
>
// one heartbeat task was persisted multiple times with different taskIDs due to the retry logic
236
>
// for updating workflow execution. In that case, only one new heartbeat timeout task should be
237
>
// created.
238
>
isHeartBeatTask := task.TimeoutType == enumspb.TIMEOUT_TYPE_HEARTBEAT
239
>
ai, heartbeatTimeoutVis, ok := mutableState.GetActivityInfoWithTimerHeartbeat(task.EventID)
240
>
if isHeartBeatTask && ok && queues.IsTimeExpired(task, task.GetVisibilityTime(), mutableState.ToRealTime(heartbeatTimeoutVis)) {
241
if err := mutableState.UpdateActivityTaskStatusWithTimerHeartbeat(
242
ai.ScheduledEventId, ai.TimerTaskStatus&^workflow.TimerTaskStatusCreatedHeartbeat, nil); err != nil {