history.Sync: Don't operate on closed channel

This commit is contained in:
Yonas Habteab 2024-03-28 14:52:27 +01:00
parent 51e5434374
commit ce56dffa8f

View file

@ -144,7 +144,11 @@ func (s Sync) deleteFromRedis(ctx context.Context, key string, input <-chan redi
stream := "icinga:history:stream:" + key
for {
select {
case bulk := <-bulks:
case bulk, ok := <-bulks:
if !ok {
return nil
}
ids := make([]string, len(bulk))
for i := range bulk {
ids[i] = bulk[i].ID