Skip to content

Commit

Permalink
Ensure requested at is only set when a task was manually requested (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lyondhill authored Mar 29, 2019
1 parent 9a9432e commit 1d405f9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions task/backend/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ func (tcs *taskControlAdaptor) UpdateRunState(ctx context.Context, taskID, runID
Task: st,
RunID: runID,
RunScheduledFor: schedFor.Unix(),
RequestedAt: reqAt.Unix(),
}

if !reqAt.IsZero() {
rlb.RequestedAt = reqAt.Unix()
}
if err := tcs.lw.UpdateRunState(ctx, rlb, when, state); err != nil {
return err
}
Expand Down Expand Up @@ -200,7 +201,9 @@ func (tcs *taskControlAdaptor) AddRunLog(ctx context.Context, taskID, runID infl
Task: st,
RunID: runID,
RunScheduledFor: schedFor.Unix(),
RequestedAt: reqAt.Unix(),
}
if !reqAt.IsZero() {
rlb.RequestedAt = reqAt.Unix()
}
return tcs.lw.AddRunLog(ctx, rlb, when, log)
}
Expand Down

0 comments on commit 1d405f9

Please sign in to comment.