Browse Source

producer: simplify initial "too large" check

Minor oddity I noticed while working on the aggregator/flusher refactor; this
looks like vestigial code from some attempt at handling the weird size
requirements of compressed message batches, but since `msg.byteSize()`
*includes* `msg.Value.Length()` if appropriate, the entire first condition of
this `||` is superceded by the second.
Evan Huus 10 years ago
parent
commit
2d2d5472f8
1 changed files with 1 additions and 3 deletions
  1. 1 3
      async_producer.go

+ 1 - 3
async_producer.go

@@ -249,9 +249,7 @@ func (p *asyncProducer) dispatcher() {
 			p.inFlight.Add(1)
 		}
 
-		if (p.conf.Producer.Compression == CompressionNone && msg.Value != nil && msg.Value.Length() > p.conf.Producer.MaxMessageBytes) ||
-			(msg.byteSize() > p.conf.Producer.MaxMessageBytes) {
-
+		if msg.byteSize() > p.conf.Producer.MaxMessageBytes {
 			p.returnError(msg, ErrMessageSizeTooLarge)
 			continue
 		}