Skip to content

Commit bf720c0

Browse files
committed
fix: remove closed check when starting notification manager
1 parent 208fcc2 commit bf720c0

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

coderd/notifications/manager.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ type Manager struct {
5353
success, failure chan dispatchResult
5454

5555
mu sync.Mutex // Protects following.
56-
closed bool
5756
notifier *notifier
5857

5958
runOnce sync.Once
@@ -161,11 +160,6 @@ func (m *Manager) loop(ctx context.Context) error {
161160
}()
162161

163162
m.mu.Lock()
164-
if m.closed {
165-
m.mu.Unlock()
166-
return xerrors.New("manager already closed")
167-
}
168-
169163
var eg errgroup.Group
170164

171165
m.notifier = newNotifier(ctx, m.cfg, uuid.New(), m.log, m.store, m.handlers, m.helpers, m.metrics, m.clock)
@@ -354,11 +348,6 @@ func (m *Manager) Stop(ctx context.Context) error {
354348
m.mu.Lock()
355349
defer m.mu.Unlock()
356350

357-
if m.closed {
358-
return nil
359-
}
360-
m.closed = true
361-
362351
m.log.Debug(context.Background(), "graceful stop requested")
363352

364353
// If the notifier hasn't been started, we don't need to wait for anything.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy