diff --git a/consume.go b/consume.go index 4517c5d..ab6b692 100644 --- a/consume.go +++ b/consume.go @@ -131,6 +131,8 @@ func (consumer *Consumer) startGoroutines( handler Handler, options ConsumerOptions, ) error { + consumer.isClosedMux.Lock() + defer consumer.isClosedMux.Unlock() err := consumer.chanManager.QosSafe( options.QOSPrefetch, 0,