mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 07:26:13 +02:00
* switch to ioredis
also need this fix in redisearch:
redis-search.js:98
```
redisClient.multi(cmds).exec(function(err, ids) {
if (err) {
return callback(err);
}
var errRes = ids[resultIndex];
if (errRes[0]) {
return callback(errRes[0]);
}
callback(null, errRes[1]);
});
```
* dbsearch compatible with ioredis
* fixed dbsearch?
This commit is contained in:
@@ -111,6 +111,14 @@ module.exports = function (module) {
|
||||
data = [await module.client.async.hgetall(unCachedKeys[0])];
|
||||
}
|
||||
|
||||
// convert empty objects into null for back-compat with node_redis
|
||||
data = data.map((elem) => {
|
||||
if (!Object.keys(elem).length) {
|
||||
return null;
|
||||
}
|
||||
return elem;
|
||||
});
|
||||
|
||||
unCachedKeys.forEach((key, i) => {
|
||||
cachedData[key] = data[i] || null;
|
||||
cache.set(key, cachedData[key]);
|
||||
|
||||
Reference in New Issue
Block a user