Skip to content

Commit

Permalink
Fix: use coordinator clock for task started
Browse files Browse the repository at this point in the history
  • Loading branch information
runabol committed Dec 11, 2023
1 parent 9705140 commit d4ed8cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/coordinator/handlers/started.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package handlers

import (
"context"
"time"

"github.com/rs/zerolog/log"
"github.com/runabol/tork"
Expand Down Expand Up @@ -47,8 +48,10 @@ func (h *startedHandler) handle(ctx context.Context, et task.EventType, t *tork.
// if an out-of-order task completion/failure
// arrived earlier
if u.State == tork.TaskStateScheduled {
now := time.Now().UTC()
t.StartedAt = &now
u.State = tork.TaskStateRunning
u.StartedAt = t.StartedAt
u.StartedAt = &now
u.NodeID = t.NodeID
}
return nil
Expand Down

0 comments on commit d4ed8cd

Please sign in to comment.