File tree 2 files changed +9
-6
lines changed
site/src/pages/DeploySettingsPage
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ type Manager struct {
54
54
55
55
runOnce sync.Once
56
56
stopOnce sync.Once
57
+ doneOnce sync.Once
57
58
stop chan any
58
59
done chan any
59
60
@@ -153,9 +154,9 @@ func (m *Manager) Run(ctx context.Context) {
153
154
// events, creating a notifier, and publishing bulk dispatch result updates to the store.
154
155
func (m * Manager ) loop (ctx context.Context ) error {
155
156
defer func () {
156
- if m . notifier != nil {
157
+ m . doneOnce . Do ( func () {
157
158
close (m .done )
158
- }
159
+ })
159
160
m .log .Info (context .Background (), "notification manager stopped" )
160
161
}()
161
162
@@ -363,11 +364,13 @@ func (m *Manager) Stop(ctx context.Context) error {
363
364
364
365
m .log .Info (context .Background (), "graceful stop requested" )
365
366
367
+ m .doneOnce .Do (func () {
368
+ close (m .done )
369
+ })
370
+
366
371
// If the notifier hasn't been started, we don't need to wait for anything.
367
372
// This is only really during testing when we want to enqueue messages only but not deliver them.
368
- if m .notifier == nil {
369
- close (m .done )
370
- } else {
373
+ if m .notifier != nil {
371
374
m .notifier .stop ()
372
375
}
373
376
Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ import NotificationsIcon from "@mui/icons-material/NotificationsNoneOutlined";
7
7
import Globe from "@mui/icons-material/PublicOutlined" ;
8
8
import ApprovalIcon from "@mui/icons-material/VerifiedUserOutlined" ;
9
9
import VpnKeyOutlined from "@mui/icons-material/VpnKeyOutlined" ;
10
+ import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge" ;
10
11
import { GitIcon } from "components/Icons/GitIcon" ;
11
12
import {
12
13
Sidebar as BaseSidebar ,
13
14
SidebarNavItem ,
14
15
} from "components/Sidebar/Sidebar" ;
15
16
import { useDashboard } from "modules/dashboard/useDashboard" ;
16
17
import type { FC } from "react" ;
17
- import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge" ;
18
18
19
19
export const Sidebar : FC = ( ) => {
20
20
const { experiments } = useDashboard ( ) ;
You can’t perform that action at this time.
0 commit comments