Skip to content

Commit

Permalink
wg.Add len of decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Aug 16, 2024
1 parent a4b4b53 commit d8ed1db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bar.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,8 @@ func (s bState) completed() bool {
}

func (s bState) decoratorEwmaUpdate(n int64, dur time.Duration, wg *sync.WaitGroup) {
wg.Add(len(s.ewmaDecorators))
for _, d := range s.ewmaDecorators {
wg.Add(1)
d := d
go func() {
d.EwmaUpdate(n, dur)
Expand All @@ -592,8 +592,8 @@ func (s bState) decoratorEwmaUpdate(n int64, dur time.Duration, wg *sync.WaitGro
}

func (s bState) decoratorAverageAdjust(start time.Time, wg *sync.WaitGroup) {
wg.Add(len(s.averageDecorators))
for _, d := range s.averageDecorators {
wg.Add(1)
d := d
go func() {
d.AverageAdjust(start)
Expand All @@ -603,8 +603,8 @@ func (s bState) decoratorAverageAdjust(start time.Time, wg *sync.WaitGroup) {
}

func (s bState) decoratorShutdownNotify(wg *sync.WaitGroup) {
wg.Add(len(s.shutdownListeners))
for _, d := range s.shutdownListeners {
wg.Add(1)
d := d
go func() {
d.OnShutdown()
Expand Down

0 comments on commit d8ed1db

Please sign in to comment.