Skip to content

Commit f2bc42e

Browse files
authored
Merge pull request zeromicro#52 from algobot76/fix-typo-producer
fix: typo produer
2 parents 19cc7bf + 4941f4a commit f2bc42e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kq/pusher.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type (
1414
PushOption func(options *chunkOptions)
1515

1616
Pusher struct {
17-
produer *kafka.Writer
17+
producer *kafka.Writer
1818
topic string
1919
executor *executors.ChunkExecutor
2020
}
@@ -33,15 +33,15 @@ func NewPusher(addrs []string, topic string, opts ...PushOption) *Pusher {
3333
Compression: kafka.Snappy,
3434
}
3535
pusher := &Pusher{
36-
produer: producer,
37-
topic: topic,
36+
producer: producer,
37+
topic: topic,
3838
}
3939
pusher.executor = executors.NewChunkExecutor(func(tasks []interface{}) {
4040
chunk := make([]kafka.Message, len(tasks))
4141
for i := range tasks {
4242
chunk[i] = tasks[i].(kafka.Message)
4343
}
44-
if err := pusher.produer.WriteMessages(context.Background(), chunk...); err != nil {
44+
if err := pusher.producer.WriteMessages(context.Background(), chunk...); err != nil {
4545
logx.Error(err)
4646
}
4747
}, newOptions(opts)...)
@@ -53,8 +53,8 @@ func (p *Pusher) Close() error {
5353
if p.executor != nil {
5454
p.executor.Flush()
5555
}
56-
57-
return p.produer.Close()
56+
57+
return p.producer.Close()
5858
}
5959

6060
func (p *Pusher) Name() string {
@@ -69,7 +69,7 @@ func (p *Pusher) Push(v string) error {
6969
if p.executor != nil {
7070
return p.executor.Add(msg, len(v))
7171
} else {
72-
return p.produer.WriteMessages(context.Background(), msg)
72+
return p.producer.WriteMessages(context.Background(), msg)
7373
}
7474
}
7575

0 commit comments

Comments
 (0)