Skip to content

Commit

Permalink
fix(api): remove addSpawnInfo from loop (#5112)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux authored Apr 7, 2020
1 parent a64cb2f commit 2e8a66c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions engine/api/workflow/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -1438,8 +1438,8 @@ func Push(ctx context.Context, db *gorp.DbMap, store cache.Store, proj *sdk.Proj
fromRepo = opts.FromRepository
}
envDB, msgList, err := environment.ParseAndImport(tx, *proj, env, environment.ImportOptions{Force: true, FromRepository: fromRepo}, decryptFunc, u)
allMsg = append(allMsg, msgList...)
if err != nil {
allMsg = append(allMsg, msgList...)
if err != nil {
return allMsg, nil, nil, sdk.ErrorWithFallback(err, sdk.ErrWrongRequest, "unable to import environment %s/%s", proj.Key, env.Name)
}
proj.SetEnvironment(*envDB)
Expand All @@ -1451,8 +1451,8 @@ func Push(ctx context.Context, db *gorp.DbMap, store cache.Store, proj *sdk.Proj
fromRepo = opts.FromRepository
}
pipDB, msgList, err := pipeline.ParseAndImport(ctx, tx, store, *proj, &pip, u, pipeline.ImportOptions{Force: true, FromRepository: fromRepo})
allMsg = append(allMsg, msgList...)
if err != nil {
allMsg = append(allMsg, msgList...)
if err != nil {
return allMsg, nil, nil, sdk.ErrorWithFallback(err, sdk.ErrWrongRequest, "unable to import pipeline %s/%s", proj.Key, pip.Name)
}
proj.SetPipeline(*pipDB)
Expand All @@ -1478,8 +1478,8 @@ func Push(ctx context.Context, db *gorp.DbMap, store cache.Store, proj *sdk.Proj
}

wf, msgList, err := ParseAndImport(ctx, tx, store, *proj, oldWf, data.Workflow, u, importOptions)
allMsg = append(allMsg, msgList...)
if err != nil {
allMsg = append(allMsg, msgList...)
if err != nil {
return allMsg, nil, nil, sdk.WrapError(err, "unable to import workflow %s", data.Workflow.GetName())
}

Expand Down
3 changes: 2 additions & 1 deletion engine/api/workflow_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,9 @@ func (api *API) initWorkflowRun(ctx context.Context, projKey string, wf *sdk.Wor
Args: msg.Args,
Type: msg.Type,
}
workflow.AddWorkflowRunInfo(wfRun, infos...)

}
workflow.AddWorkflowRunInfo(wfRun, infos...)
r1 := failInitWorkflowRun(ctx, api.mustDB(), wfRun, sdk.WrapError(err, "unable to get workflow from repository"))
report.Merge(ctx, r1)
return
Expand Down

0 comments on commit 2e8a66c

Please sign in to comment.