8000 fix(api): fill data in last_execution (#3144) · ovh/cds@dbd272a · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit dbd272a

Browse files
bnjjjyesnault
authored andcommitted
fix(api): fill data in last_execution (#3144)
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
1 parent 9cb5de8 commit dbd272a

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

engine/api/workflow/run_workflow.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ func RunFromHook(ctx context.Context, dbCopy *gorp.DbMap, db gorp.SqlExecutor, s
5252

5353
//Compute a new workflow run
5454
wr := &sdk.WorkflowRun{
55-
Number: number,
56-
Workflow: *w,
57-
WorkflowID: w.ID,
58-
Start: time.Now(),
59-
LastModified: time.Now(),
60-
ProjectID: w.ProjectID,
61-
Status: string(sdk.StatusWaiting),
55+
Number: number,
56+
Workflow: *w,
57+
WorkflowID: w.ID,
58+
Start: time.Now(),
59+
LastModified: time.Now(),
60+
ProjectID: w.ProjectID,
61+
Status: string(sdk.StatusWaiting),
62+
LastExecution: time.Now(),
6263
}
6364

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

164165
wr := &sdk.WorkflowRun{
165-
Number: number,
166-
Workflow: *w,
167-
WorkflowID: w.ID,
168-
Start: time.Now(),
169-
LastModified: time.Now(),
170-
ProjectID: w.ProjectID,
171-
Status: sdk.StatusWaiting.String(),
166+
Number: number,
167+
Workflow: *w,
168+
WorkflowID: w.ID,
169+
Start: time.Now(),
170+
LastModified: time.Now(),
171+
ProjectID: w.ProjectID,
172+
Status: sdk.StatusWaiting.String(),
173+
LastExecution: time.Now(),
172174
}
173175
wr.Tag(tagTriggeredBy, e.User.Username)
174176

0 commit comments

Comments
 (0)
0