weed/operation: fix dropped error (#4888)

This commit is contained in:
Lars Lehtonen 2023-10-03 10:55:20 -07:00 committed by GitHub
parent 6ebe26a765
commit 530bdedf76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,6 +188,9 @@ func doUploadData(data []byte, option *UploadOption) (uploadResult *UploadResult
} else if !iAmSure && option.MimeType == "" && len(data) > 16*1024 { } else if !iAmSure && option.MimeType == "" && len(data) > 16*1024 {
var compressed []byte var compressed []byte
compressed, err = util.GzipData(data[0:128]) compressed, err = util.GzipData(data[0:128])
if err != nil {
return
}
shouldGzipNow = len(compressed)*10 < 128*9 // can not compress to less than 90% shouldGzipNow = len(compressed)*10 < 128*9 // can not compress to less than 90%
} }
} }