Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Sep 5, 2023
1 parent d1080ed commit c664b62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/reporter/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ func (r reporter) Run() {
periodic := time.NewTicker(r.cfg.ReportInterval)
signals := make(chan os.Signal, 1)
signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
// ensure that

for {
select {
case <-periodic.C:
Expand Down Expand Up @@ -78,6 +76,7 @@ func (r reporter) collectAndReport() error {

var items []*leases.ReportItem
for _, l := range byMac {
l := l
if !r.isInAllowedCidr(l.Ip) {
continue
}
Expand All @@ -95,6 +94,7 @@ func (r reporter) collectAndReport() error {
r.log.Infow("reporting leases to metal-api", "count", len(items))

g := new(errgroup.Group)
// Allow 20 goroutines run in parallel at max
g.SetLimit(20)
for _, item := range items {
item := item
Expand Down

0 comments on commit c664b62

Please sign in to comment.