Skip to content

Commit

Permalink
fix: return at least one in sizeCalculation (#10832)
Browse files Browse the repository at this point in the history
if post content is empty post cache should still consider its size to be at least one. fixes #10831
  • Loading branch information
oplik0 authored and julianlam committed Aug 15, 2022
1 parent 6f9fa8c commit 3975fa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/posts/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const meta = require('../meta');
module.exports = cacheCreate({
name: 'post',
maxSize: meta.config.postCacheSize,
sizeCalculation: function (n) { return n.length; },
sizeCalculation: function (n) { return n.length || 1; },
ttl: 0,
enabled: global.env === 'production',
});

0 comments on commit 3975fa2

Please sign in to comment.