refactor: posts cache to get rid of require in functions

This commit is contained in:
Barış Soner Uşaklı
2024-06-10 17:10:43 -04:00
parent b4db2f7faf
commit 236ac32303
8 changed files with 40 additions and 17 deletions

View File

@@ -6,7 +6,7 @@ const utils = require('../../utils');
const plugins = require('../../plugins');
cacheController.get = async function (req, res) {
const postCache = require('../../posts/cache');
const postCache = require('../../posts/cache').getOrCreate();
const groupCache = require('../../groups').cache;
const { objectCache } = require('../../database');
const localCache = require('../../cache');
@@ -46,7 +46,7 @@ cacheController.get = async function (req, res) {
cacheController.dump = async function (req, res, next) {
let caches = {
post: require('../../posts/cache'),
post: require('../../posts/cache').getOrCreate(),
object: require('../../database').objectCache,
group: require('../../groups').cache,
local: require('../../cache'),