mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46: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')];
|
const keyInfo = redisData['db' + nconf.get('redis:database')];
|
||||||
if (keyInfo) {
|
if (keyInfo) {
|
||||||
redisData.keys = keyInfo.split(',')[0].replace('keys=', '');
|
const split = keyInfo.split(',');
|
||||||
redisData.expires = keyInfo.split(',')[1].replace('expires=', '');
|
redisData.keys = (split[0] || '').replace('keys=', '');
|
||||||
redisData.avg_ttl = keyInfo.split(',')[2].replace('avg_ttl=', '');
|
redisData.expires = (split[1] || '').replace('expires=', '');
|
||||||
|
redisData.avg_ttl = (split[2] || '').replace('avg_ttl=', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
redisData.instantaneous_input = (redisData.instantaneous_input_kbps / 1024).toFixed(3);
|
redisData.instantaneous_input = (redisData.instantaneous_input_kbps / 1024).toFixed(3);
|
||||||
|
|||||||
Reference in New Issue
Block a user