Skip to content

Commit

Permalink
删除不需要的导致空指针的锁
Browse files Browse the repository at this point in the history
  • Loading branch information
hmzzrcs committed Apr 3, 2023
1 parent 27a9313 commit a55c106
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/output/kafka/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ type tProducer struct {
conf *ProducerConfig
cancel context.CancelFunc
enable bool
locker *sync.Mutex
formatter eosc.IFormatter
}

Expand Down Expand Up @@ -101,9 +100,9 @@ func (o *tProducer) write(msg *sarama.ProducerMessage) {
if !o.enable {
return
}
o.locker.Lock()

o.input <- msg
o.locker.Unlock()

}

func (o *tProducer) work() {
Expand Down

0 comments on commit a55c106

Please sign in to comment.