mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: return at least one in sizeCalculation (#10832)
if post content is empty post cache should still consider its size to be at least one. fixes #10831
This commit is contained in:
@@ -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',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user