Skip to content

Commit 249fe54

Browse files
authored
Merge pull request #159 from johanneswuerbach/fix-close-race
fix: consumer close before run
2 parents eebea88 + e564b43 commit 249fe54

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

consume.go

+2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ func (consumer *Consumer) startGoroutines(
131131
handler Handler,
132132
options ConsumerOptions,
133133
) error {
134+
consumer.isClosedMux.Lock()
135+
defer consumer.isClosedMux.Unlock()
134136
err := consumer.chanManager.QosSafe(
135137
options.QOSPrefetch,
136138
0,

0 commit comments

Comments
 (0)