File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
health-monitors/csp-health-monitor/pkg/csp/aws Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments