mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: psql test
This commit is contained in:
@@ -2,11 +2,13 @@
|
|||||||
|
|
||||||
const SocketCache = module.exports;
|
const SocketCache = module.exports;
|
||||||
|
|
||||||
|
const db = require('../../database');
|
||||||
|
|
||||||
SocketCache.clear = async function (socket, data) {
|
SocketCache.clear = async function (socket, data) {
|
||||||
if (data.name === 'post') {
|
if (data.name === 'post') {
|
||||||
require('../../posts/cache').reset();
|
require('../../posts/cache').reset();
|
||||||
} else if (data.name === 'object') {
|
} else if (data.name === 'object' && db.objectCache) {
|
||||||
require('../../database').objectCache.reset();
|
db.objectCache.reset();
|
||||||
} else if (data.name === 'group') {
|
} else if (data.name === 'group') {
|
||||||
require('../../groups').cache.reset();
|
require('../../groups').cache.reset();
|
||||||
} else if (data.name === 'local') {
|
} else if (data.name === 'local') {
|
||||||
@@ -17,7 +19,7 @@ SocketCache.clear = async function (socket, data) {
|
|||||||
SocketCache.toggle = async function (socket, data) {
|
SocketCache.toggle = async function (socket, data) {
|
||||||
const caches = {
|
const caches = {
|
||||||
post: require('../../posts/cache'),
|
post: require('../../posts/cache'),
|
||||||
object: require('../../database').objectCache,
|
object: db.objectCache,
|
||||||
group: require('../../groups').cache,
|
group: require('../../groups').cache,
|
||||||
local: require('../../cache'),
|
local: require('../../cache'),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user