Skip to content

Commit

Permalink
fix(api): fill data in last_execution (#3144)
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Coenen <[email protected]>
  • Loading branch information
bnjjj authored and yesnault committed Aug 6, 2018
1 parent 9cb5de8 commit dbd272a
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions engine/api/workflow/run_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ func RunFromHook(ctx context.Context, dbCopy *gorp.DbMap, db gorp.SqlExecutor, s

//Compute a new workflow run
wr := &sdk.WorkflowRun{
Number: number,
Workflow: *w,
WorkflowID: w.ID,
Start: time.Now(),
LastModified: time.Now(),
ProjectID: w.ProjectID,
Status: string(sdk.StatusWaiting),
Number: number,
Workflow: *w,
WorkflowID: w.ID,
Start: time.Now(),
LastModified: time.Now(),
ProjectID: w.ProjectID,
Status: string(sdk.StatusWaiting),
LastExecution: time.Now(),
}

if trigg, ok := e.Payload["cds.triggered_by.username"]; ok {
Expand Down Expand Up @@ -162,13 +163,14 @@ func ManualRun(ctx context.Context, db gorp.SqlExecutor, store cache.Store, p *s
defer end()

wr := &sdk.WorkflowRun{
Number: number,
Workflow: *w,
WorkflowID: w.ID,
Start: time.Now(),
LastModified: time.Now(),
ProjectID: w.ProjectID,
Status: sdk.StatusWaiting.String(),
Number: number,
Workflow: *w,
WorkflowID: w.ID,
Start: time.Now(),
LastModified: time.Now(),
ProjectID: w.ProjectID,
Status: sdk.StatusWaiting.String(),
LastExecution: time.Now(),
}
wr.Tag(tagTriggeredBy, e.User.Username)

Expand Down

0 comments on commit dbd272a

Please sign in to comment.