Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notifications config sync #177

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Use upsert statement...
... instead of insert statement, so the non locked entries are overwritten.
jrauh01 committed Feb 18, 2025
commit ec2d262067fa06d4566b335c3d4521990fe5985c
2 changes: 1 addition & 1 deletion internal/notifications.go
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ func SyncNotificationsConfig(ctx context.Context, db *database.DB, config *notif
return errors.Wrap(err, "cannot delete Icinga Notifications config")
}

stmt, _ := db.BuildInsertStmt(schemav1.Config{})
stmt, _ := db.BuildUpsertStmt(schemav1.Config{})
if _, err := tx.NamedExecContext(ctx, stmt, toDb); err != nil {
return errors.Wrap(err, "cannot insert Icinga Notifications config")
}