Skip to content

Commit 2e7753b

Browse files
committed
revert pendingItem.done() to its old position
1 parent d005752 commit 2e7753b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

pulsar/producer_partition.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -848,21 +848,6 @@ type pendingItem struct {
848848
flushCallback func(err error)
849849
}
850850

851-
func (i *pendingItem) done(err error) {
852-
if i.isDone {
853-
return
854-
}
855-
i.isDone = true
856-
buffersPool.Put(i.buffer)
857-
if i.flushCallback != nil {
858-
i.flushCallback(err)
859-
}
860-
861-
if i.cancel != nil {
862-
i.cancel()
863-
}
864-
}
865-
866851
func (p *partitionProducer) internalFlushCurrentBatch() {
867852
if p.batchBuilder == nil {
868853
// batch is not enabled
@@ -1752,6 +1737,21 @@ type flushRequest struct {
17521737
err error
17531738
}
17541739

1740+
func (i *pendingItem) done(err error) {
1741+
if i.isDone {
1742+
return
1743+
}
1744+
i.isDone = true
1745+
buffersPool.Put(i.buffer)
1746+
if i.flushCallback != nil {
1747+
i.flushCallback(err)
1748+
}
1749+
1750+
if i.cancel != nil {
1751+
i.cancel()
1752+
}
1753+
}
1754+
17551755
// _setConn sets the internal connection field of this partition producer atomically.
17561756
// Note: should only be called by this partition producer when a new connection is available.
17571757
func (p *partitionProducer) _setConn(conn internal.Connection) {

0 commit comments

Comments
 (0)