diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-07-18 13:40:34 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-07-18 12:12:19 +0000 |
| commit | 13995e7680faf1839c6fd5be4a84a45a7c0805a4 (patch) | |
| tree | 3e8d5070390b3786e0b8e5c1486f19c30333ecdc /dashboard/app/reporting.go | |
| parent | 20f8b3c2cf7677e1d13af932607fa6447f144fc6 (diff) | |
dashboard: fix the Config.Decommissioned race
Race detector reports a race between
dashboard/app/reporting_test.go:1102
and
dashboard/app/handler.go:183
Fix this by storing decommission updates in the context rather than by
directly modifying the global config variable.
Diffstat (limited to 'dashboard/app/reporting.go')
| -rw-r--r-- | dashboard/app/reporting.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go index a1d916fbb..609b4cf6e 100644 --- a/dashboard/app/reporting.go +++ b/dashboard/app/reporting.go @@ -166,7 +166,7 @@ func reportingPollNotifications(c context.Context, typ string) []*dashapi.BugNot log.Infof(c, "fetched %v bugs", len(bugs)) var notifs []*dashapi.BugNotification for _, bug := range bugs { - if config.Namespaces[bug.Namespace].Decommissioned { + if isDecommissioned(c, bug.Namespace) { continue } notif, err := handleReportNotif(c, typ, bug) @@ -800,7 +800,7 @@ func reportingPollClosed(c context.Context, ids []string) ([]string, error) { break } if bug.Status >= BugStatusFixed || !bugReporting.Closed.IsZero() || - config.Namespaces[bug.Namespace].Decommissioned { + isDecommissioned(c, bug.Namespace) { closed = append(closed, bugReporting.ID) } break |
