Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: remove error log when notification manager is already closed#18264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 3 commits intomainfromethan/remove-closed-check
Jun 6, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletionscoderd/notifications/manager.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -135,6 +135,8 @@ func (m *Manager) WithHandlers(reg map[database.NotificationMethod]Handler) {
m.handlers = reg
}

var ErrManagerAlreadyClosed = xerrors.New("manager already closed")

// Run initiates the control loop in the background, which spawns a given number of notifier goroutines.
// Manager requires system-level permissions to interact with the store.
// Run is only intended to be run once.
Expand All@@ -146,7 +148,11 @@ func (m *Manager) Run(ctx context.Context) {
go func() {
err := m.loop(ctx)
if err != nil {
m.log.Error(ctx, "notification manager stopped with error", slog.Error(err))
if xerrors.Is(err, ErrManagerAlreadyClosed) {
m.log.Warn(ctx, "notification manager stopped with error", slog.Error(err))
} else {
m.log.Error(ctx, "notification manager stopped with error", slog.Error(err))
}
}
}()
})
Expand All@@ -163,7 +169,7 @@ func (m *Manager) loop(ctx context.Context) error {
m.mu.Lock()
if m.closed {
m.mu.Unlock()
returnxerrors.New("manager already closed")
returnErrManagerAlreadyClosed
}

var eg errgroup.Group
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp