Skip to content

Commit

Permalink
apply code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-stankov-golang committed Feb 2, 2023
1 parent 50368df commit dc4266b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion batcher/batcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (b *Batcher) submitWork(w *work) {
defer b.lock.Unlock()

if b.submit == nil {
b.done = make(chan bool, 1)
b.done = make(chan bool)
b.submit = make(chan *work, 4)
go b.batch()
}
Expand All @@ -98,6 +98,7 @@ func (b *Batcher) batch() {
close(future)
}
b.done <- true
close(b.done)
}

func (b *Batcher) timer() {
Expand Down

0 comments on commit dc4266b

Please sign in to comment.