mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: don't crash on outdated redis instances
This commit is contained in:
@@ -117,9 +117,10 @@ redisModule.info = function (cxn, callback) {
|
||||
|
||||
const keyInfo = redisData['db' + nconf.get('redis:database')];
|
||||
if (keyInfo) {
|
||||
redisData.keys = keyInfo.split(',')[0].replace('keys=', '');
|
||||
redisData.expires = keyInfo.split(',')[1].replace('expires=', '');
|
||||
redisData.avg_ttl = keyInfo.split(',')[2].replace('avg_ttl=', '');
|
||||
const split = keyInfo.split(',');
|
||||
redisData.keys = (split[0] || '').replace('keys=', '');
|
||||
redisData.expires = (split[1] || '').replace('expires=', '');
|
||||
redisData.avg_ttl = (split[2] || '').replace('avg_ttl=', '');
|
||||
}
|
||||
|
||||
redisData.instantaneous_input = (redisData.instantaneous_input_kbps / 1024).toFixed(3);
|
||||
|
||||
Reference in New Issue
Block a user