mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +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({ | module.exports = cacheCreate({ | ||||||
| 	name: 'post', | 	name: 'post', | ||||||
| 	maxSize: meta.config.postCacheSize, | 	maxSize: meta.config.postCacheSize, | ||||||
| 	sizeCalculation: function (n) { return n.length; }, | 	sizeCalculation: function (n) { return n.length || 1; }, | ||||||
| 	ttl: 0, | 	ttl: 0, | ||||||
| 	enabled: global.env === 'production', | 	enabled: global.env === 'production', | ||||||
| }); | }); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user