Skip to content

Commit

Permalink
fix(api): delete workflow from oldworkflow if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux committed Jun 28, 2019
1 parent 89a0dc0 commit 416abb3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions engine/api/workflow/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,14 @@ func Update(ctx context.Context, db gorp.SqlExecutor, store cache.Store, w *sdk.
}

// Delete workflow data
if err := DeleteWorkflowData(db, *w); err != nil {
return sdk.WrapError(err, "Update> unable to delete workflow data(%d - %s)", w.ID, w.Name)
if uptOption.OldWorkflow != nil {
if err := DeleteWorkflowData(db, *uptOption.OldWorkflow); err != nil {
return sdk.WrapError(err, "unable to delete from old workflow data(%d - %s)", w.ID, w.Name)
}
} else {
if err := DeleteWorkflowData(db, *w); err != nil {
return sdk.WrapError(err, "unable to delete from workflow data(%d - %s)", w.ID, w.Name)
}
}

// Delete all node ID
Expand Down

0 comments on commit 416abb3

Please sign in to comment.