Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ func initialize(dbp zesty.DBProvider, publicID string, debugLogger *logrus.Entry
return nil, nil, nil
}

{
// Making sure to prune steps whose dependencies were updated outside the engine (API, manually in DB, etc)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also perform proactive pruning in the API's handlers whenever a resolution or step is updated, but doing it here also covers updates made in the database directly.

stepsToCheck := map[string]bool{}
for stepName := range res.Steps {
stepsToCheck[stepName] = true
}
Comment on lines +364 to +367
pruneSteps(res, stepsToCheck)
}
Comment on lines +362 to +369
Comment on lines +362 to +369

if err := dbp.Commit(); err != nil {
dbp.Rollback()
return nil, nil, err
Expand Down