mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #7352
This commit is contained in:
@@ -114,6 +114,9 @@ redisModule.connect = function (options, callback) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callbackCalled = true;
|
||||
return callback(new Error('[[error:no-database-selected]]'));
|
||||
}
|
||||
|
||||
return cxn;
|
||||
@@ -186,9 +189,11 @@ 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=', '');
|
||||
}
|
||||
|
||||
redisData.instantaneous_input = (redisData.instantaneous_input_kbps / 1024).toFixed(3);
|
||||
redisData.instantaneous_output = (redisData.instantaneous_output_kbps / 1024).toFixed(3);
|
||||
|
||||
Reference in New Issue
Block a user