Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gunli committed Jul 31, 2023
1 parent 3bd5c0e commit 63b2726
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pulsar/producer_partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ func (p *partitionProducer) internalSend(sr *sendRequest) {
p.internalFlushCurrentBatch()

// after flushing try again to add the current payload
ok := addRequestToBatch(smm, p, sr.uncompressedPayload, sr, sr.msg, sr.deliverAt, sr.schemaVersion, multiSchemaEnabled)
ok := addRequestToBatch(smm, p, sr.uncompressedPayload, sr, sr.msg, sr.deliverAt,
sr.schemaVersion, multiSchemaEnabled)
if !ok {
p.log.WithField("size", sr.uncompressedSize).
WithField("properties", sr.msg.Properties).
Expand Down Expand Up @@ -1514,12 +1515,12 @@ func (p *partitionProducer) _getConn() internal.Connection {
return p.conn.Load().(internal.Connection)
}

func (p *partitionProducer) releaseSemaphoreAndMem(size int64) {
func (p *partitionProducer) releaseSemaphoreAndMem(size int64) { //nolint:unused
p.publishSemaphore.Release()
p.client.memLimit.ReleaseMemory(size)
}

func (p *partitionProducer) canAddToQueue(sr *sendRequest) bool {
func (p *partitionProducer) canAddToQueue(sr *sendRequest) bool { //nolint:unused
if p.options.DisableBlockIfQueueFull {
if !p.publishSemaphore.TryAcquire() {
runCallback(sr.callback, nil, sr.msg, errSendQueueIsFull)
Expand All @@ -1535,7 +1536,7 @@ func (p *partitionProducer) canAddToQueue(sr *sendRequest) bool {
return true
}

func (p *partitionProducer) canReserveMem(sr *sendRequest, size int64) bool {
func (p *partitionProducer) canReserveMem(sr *sendRequest, size int64) bool { //nolint:unused
if p.options.DisableBlockIfQueueFull {
if !p.client.memLimit.TryReserveMemory(size) {
p.publishSemaphore.Release()
Expand Down

0 comments on commit 63b2726

Please sign in to comment.