mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-23 05:52:57 +00:00
enforce minimum size of 1k for compression
This commit is contained in:
parent
9bb08d7ba5
commit
36f60d5bce
1 changed files with 2 additions and 1 deletions
|
@ -60,7 +60,8 @@ module.exports = ZipManager =
|
|||
callback(null, result)
|
||||
|
||||
compressIfNeeded: (doc_id, text, callback) ->
|
||||
if ZIP_WRITES_ENABLED && ZIP_MINSIZE > 0 and text.length > ZIP_MINSIZE
|
||||
if ZIP_WRITES_ENABLED and ZIP_MINSIZE > 1024 and text.length > ZIP_MINSIZE
|
||||
# N.B. skip files of 1k or less, because gzip increases the size
|
||||
zlib.gzip text, (err, buf) ->
|
||||
if err?
|
||||
logger.err doc_id:doc_id, err:err, "error compressing doc"
|
||||
|
|
Loading…
Reference in a new issue