Skip to content

Commit

Permalink
Fix: job completed date
Browse files Browse the repository at this point in the history
  • Loading branch information
runabol committed Oct 23, 2024
1 parent 0690262 commit 8448691
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/coordinator/handlers/completed.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ func (c *completedHandler) completeTopLevelTask(ctx context.Context, t *tork.Tas
if err := c.onJob(ctx, job.Progress, j); err != nil {
return err
}
now := time.Now().UTC()
if j.Position <= len(j.Tasks) {
now := time.Now().UTC()
next := j.Tasks[j.Position-1]
next.ID = uuid.NewUUID()
next.JobID = j.ID
Expand All @@ -254,6 +254,7 @@ func (c *completedHandler) completeTopLevelTask(ctx context.Context, t *tork.Tas
return c.broker.PublishTask(ctx, mq.QUEUE_PENDING, next)
} else {
j.State = tork.JobStateCompleted
j.CompletedAt = &now
return c.onJob(ctx, job.StateChange, j)
}

Expand Down

0 comments on commit 8448691

Please sign in to comment.