diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-05-03 13:23:02 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-05-03 14:00:25 +0200 |
| commit | f3eb580f055be5b4df837069f28b0e72ad3a28b3 (patch) | |
| tree | 7f71c3f9eee0097e3a0d09e2578ba5636fa7bbb1 /dashboard/app/reporting.go | |
| parent | 48e0a81d77e80af7bdc154ef423accc74517f806 (diff) | |
dashboard: move common bug filtering to createPatchTestingJobs
Diffstat (limited to 'dashboard/app/reporting.go')
| -rw-r--r-- | dashboard/app/reporting.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go index 98d7e884a..f72caacba 100644 --- a/dashboard/app/reporting.go +++ b/dashboard/app/reporting.go @@ -683,6 +683,18 @@ func foreachBug(c context.Context, filter func(*db.Query) *db.Query, fn func(bug } } +func filterBugs(bugs []*Bug, keys []*db.Key, filter func(*Bug) bool) ([]*Bug, []*db.Key) { + var retBugs []*Bug + var retKeys []*db.Key + for i, bug := range bugs { + if filter(bug) { + retBugs = append(retBugs, bugs[i]) + retKeys = append(retKeys, keys[i]) + } + } + return retBugs, retKeys +} + // reportingPollClosed is called by backends to get list of closed bugs. func reportingPollClosed(c context.Context, ids []string) ([]string, error) { idMap := make(map[string]bool, len(ids)) |
