Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 2 additions & 4 deletions pkg/icingadb/delta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@ func TestDelta(t *testing.T) {
// Log ID mapping to allow easier debugging in case of failures.
t.Logf("ID=%d(%s) Test=%s SendOrder=%s",
id, testDeltaMakeIdOrChecksum(id).String(), test.Name, sendOrder.Name)
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
sendOrder.Send(id, test, chActual, chDesired)
}()
})

if test.Create != 0 {
expectedCreate[id] = test.Create
Expand Down
2 changes: 1 addition & 1 deletion pkg/icingadb/history/sla.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var slaStateStructify = structify.MakeMapStructifier(
reflect.TypeOf((*history.SlaHistoryState)(nil)).Elem(),
reflect.TypeFor[history.SlaHistoryState](),
"json",
contracts.SafeInit)

Expand Down
2 changes: 1 addition & 1 deletion pkg/icingadb/history/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func userNotificationStage(ctx context.Context, s Sync, key string, in <-chan re
}

structifier := structify.MakeMapStructifier(
reflect.TypeOf((*NotificationHistory)(nil)).Elem(),
reflect.TypeFor[NotificationHistory](),
"structify",
contracts.SafeInit)

Expand Down
6 changes: 2 additions & 4 deletions pkg/icingaredis/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ func TestSetChecksums(t *testing.T) {
t.Run(fmt.Sprint(concurrency), func(t *testing.T) {
for _, l := range latencies {
t.Run(l.name, func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ctx := t.Context()

input := make(chan database.Entity, 1)
go func() {
Expand Down Expand Up @@ -311,8 +310,7 @@ func TestSetChecksums(t *testing.T) {

for _, concurrency := range []int{0, -1, -2, -30} {
t.Run(fmt.Sprint(concurrency), func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ctx := t.Context()

input := make(chan database.Entity, 1)
input <- nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/notifications/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func (client *Client) Submit(entity database.Entity) bool {
// This loop allows resubmitting an event if the rules have changed. The first try would be the rule update, the
// second try would be the resubmit, and the third try would be for bad luck, e.g., when a second rule update just
// crept in between. If there are three subsequent rule updates, something is wrong.
for try := 0; try < 3; try++ {
for range 3 {
eventRuleIds, err := client.evaluateRulesForObject(
client.ctx,
metaHistory.HostId,
Expand Down Expand Up @@ -484,7 +484,7 @@ func (client *Client) SyncExtraStages() map[string]history.StageFunc {
}

sorterCallbackFn := func(msg redis.XMessage, key string) bool {
makeEntity := func(key string, values map[string]interface{}) (database.Entity, error) {
makeEntity := func(key string, values map[string]any) (database.Entity, error) {
structPtr, ok := syncKeyStructPtrs[key]
if !ok {
return nil, fmt.Errorf("key is not part of keyStructPtrs")
Expand Down
Loading