Skip to content

Commit 874941b

Browse files
committed
chore: minor changes
Signed-off-by: Tanisha goyal <[email protected]>
1 parent 10a4c13 commit 874941b

File tree

1 file changed

+6
-6
lines changed
  • health-monitors/csp-health-monitor/pkg/csp/aws

1 file changed

+6
-6
lines changed

health-monitors/csp-health-monitor/pkg/csp/aws/aws.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ func (c *AWSClient) handleMaintenanceEvents(
361361

362362
var wg sync.WaitGroup
363363

364+
var mu sync.Mutex
365+
364366
var errs *multierror.Error
365367

366368
for eventID, event := range eventArnsMap {
@@ -385,7 +387,11 @@ func (c *AWSClient) handleMaintenanceEvents(
385387
"eventID", eventID,
386388
"error", err)
387389

390+
mu.Lock()
391+
388392
errs = multierror.Append(errs, err)
393+
394+
mu.Unlock()
389395
}
390396
}(eventID, event)
391397
}
@@ -486,8 +492,6 @@ func (c *AWSClient) processAWSHealthEvent(
486492

487493
var errs *multierror.Error
488494

489-
var mu sync.Mutex
490-
491495
desc := c.getEventDescription(ctx, evt)
492496
action := c.mapToValidAction(desc)
493497

@@ -507,11 +511,7 @@ func (c *AWSClient) processAWSHealthEvent(
507511
"eventArn", eventArn,
508512
"error", err)
509513

510-
mu.Lock()
511-
512514
errs = multierror.Append(errs, err)
513-
514-
mu.Unlock()
515515
}
516516
}
517517

0 commit comments

Comments
 (0)