mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 06:26:35 +02:00
Mongo cache (#6002)
* cache mongodb objects remove user settings cache since it is cached at the object level * removed indexOf from isMemberOfSets * change has to get, change maxAge to 0
This commit is contained in:
committed by
GitHub
parent
7ad4420b6a
commit
e7318a1cea
@@ -15,7 +15,7 @@ var LRU = require('lru-cache');
|
||||
|
||||
var cache = LRU({
|
||||
max: 40000,
|
||||
maxAge: 1000 * 60 * 60,
|
||||
maxAge: 0,
|
||||
});
|
||||
|
||||
module.exports = function (Groups) {
|
||||
@@ -382,7 +382,7 @@ module.exports = function (Groups) {
|
||||
}
|
||||
|
||||
var nonCachedUids = uids.filter(function (uid) {
|
||||
return !cache.has(uid + ':' + groupName);
|
||||
return !cache.get(uid + ':' + groupName);
|
||||
});
|
||||
|
||||
if (!nonCachedUids.length) {
|
||||
@@ -415,7 +415,7 @@ module.exports = function (Groups) {
|
||||
}
|
||||
|
||||
var nonCachedGroups = groups.filter(function (groupName) {
|
||||
return !cache.has(uid + ':' + groupName);
|
||||
return !cache.get(uid + ':' + groupName);
|
||||
});
|
||||
|
||||
if (!nonCachedGroups.length) {
|
||||
|
||||
Reference in New Issue
Block a user