Skip to content

Commit 5ec8710

Browse files
committed
fix race on reuse msg
1 parent 6079f22 commit 5ec8710

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

producer/nsq.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (n *NSQ) inputMsg(topic string, mCh chan []byte, ec *uint64) {
7272
break
7373
}
7474

75-
err = n.producer.Publish(topic, msg)
75+
err = n.producer.Publish(topic, append([]byte{}, msg...))
7676
if err != nil {
7777
n.logger.Println(err)
7878
*ec++

0 commit comments

Comments
 (0)