Browse Source

Launch those two goroutines withRecover

Evan Huus 11 years ago
parent
commit
7232350a51
1 changed files with 4 additions and 4 deletions
  1. 4 4
      producer.go

+ 4 - 4
producer.go

@@ -208,15 +208,15 @@ func (p *Producer) Input() chan<- *MessageToSend {
 // it may otherwise leak memory. You must call this before calling Close on the
 // underlying client.
 func (p *Producer) Close() error {
-	go func() {
+	go withRecover(func() {
 		p.input <- &MessageToSend{flags: shutdown}
-	}()
+	})
 
 	if p.config.AckSuccesses {
-		go func() {
+		go withRecover(func() {
 			for _ = range p.successes {
 			}
-		}()
+		})
 	}
 
 	var errors ProduceErrors