浏览代码

Merge pull request #545 from Shopify/simpler-size-check

producer: simplify initial "too large" check
Evan Huus 10 年之前
父节点
当前提交
a23cf43069
共有 1 个文件被更改,包括 1 次插入3 次删除
  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
 		}