From dc4266b7caaf157bceb1ef575563385950508869 Mon Sep 17 00:00:00 2001 From: Ivan Stankov Date: Thu, 2 Feb 2023 15:30:06 +0200 Subject: [PATCH] apply code review comments --- batcher/batcher.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/batcher/batcher.go b/batcher/batcher.go index 6dbe22a..2261805 100644 --- a/batcher/batcher.go +++ b/batcher/batcher.go @@ -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() } @@ -98,6 +98,7 @@ func (b *Batcher) batch() { close(future) } b.done <- true + close(b.done) } func (b *Batcher) timer() {