Skip to content

Commit f5e3dd7

Browse files
authored
Remove tight loop from alertmanager init() (#2179)
* Remove tight loop from alertmanager init() * Rewrite 'for...select' as 'for range' to please lint Signed-off-by: Bryan Boreham <[email protected]>
1 parent 9cec079 commit f5e3dd7

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pkg/alertmanager/alertmanager.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,10 @@ var webReload = make(chan chan error)
7272

7373
func init() {
7474
go func() {
75-
for {
76-
select {
77-
// Since this is not a "normal" Alertmanager which reads its config
78-
// from disk, we just ignore web-based reload signals. Config updates are
79-
// only applied externally via ApplyConfig().
80-
case <-webReload:
81-
default:
82-
continue
83-
}
75+
// Since this is not a "normal" Alertmanager which reads its config
76+
// from disk, we just accept and ignore web-based reload signals. Config
77+
// updates are only applied externally via ApplyConfig().
78+
for range webReload {
8479
}
8580
}()
8681
}

0 commit comments

Comments
 (0)