Skip to content

Node.js based forum software built for the modern web

refactor: move requires down

Barış Soner Uşaklı8eccdb481f62
diff --git a/src/posts/cache.js b/src/posts/cache.js
index b08b72521f..bb65026ae4 100644
--- a/src/posts/cache.js
+++ b/src/posts/cache.js
@@ -1,12 +1,11 @@
'use strict';
-const cacheCreate = require('../cache/lru');
-const meta = require('../meta');
-
let cache = null;
exports.getOrCreate = function () {
if (!cache) {
+ const cacheCreate = require('../cache/lru');
+ const meta = require('../meta');
cache = cacheCreate({
name: 'post',
maxSize: meta.config.postCacheSize,