Skip to content

Commit

Permalink
Removed identical revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed Aug 17, 2023
1 parent c909e66 commit d994712
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions db-connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -5419,6 +5419,20 @@ func ListWorkflowRevisions(ctx context.Context, originalId string) ([]Workflow,
return workflows[i].Edited > workflows[j].Edited
})

// Deduplicate based on edited time
filtered := []Workflow{}
handled := []string{}
for _, workflow := range workflows {
if ArrayContains(handled, string(workflow.Edited)) {
continue
}

handled = append(handled, string(workflow.Edited))
filtered = append(filtered, workflow)
}



// Set cache
if project.CacheDb {
cacheData, err := json.Marshal(workflows)
Expand Down

0 comments on commit d994712

Please sign in to comment.