Skip to content

Node.js based forum software built for the modern web

remove unused clearRequireCache, closes #5021

barisusakli77c549081c49
diff --git a/src/plugins.js b/src/plugins.js
index fc56d799c6..0d6bb02fb5 100644
--- a/src/plugins.js
+++ b/src/plugins.js
@@ -406,31 +406,4 @@ var middleware;
], callback);
};
- Plugins.clearRequireCache = function(next) {
- var cached = Object.keys(require.cache);
- async.waterfall([
- async.apply(async.map, Plugins.libraryPaths, fs.realpath),
- function(paths, next) {
- paths = paths.map(function(pluginLib) {
- var parent = path.dirname(pluginLib);
- return cached.filter(function(libPath) {
- return libPath.indexOf(parent) !== -1;
- });
- }).reduce(function(prev, cur) {
- return prev.concat(cur);
- });
-
- Plugins.fireHook('filter:plugins.clearRequireCache', {paths: paths}, next);
- },
- function(data, next) {
- for (var x=0,numPaths=data.paths.length;x<numPaths;x++) {
- delete require.cache[data.paths[x]];
- }
- winston.verbose('[plugins] Plugin libraries removed from Node.js cache');
-
- next();
- }
- ], next);
- };
-
}(exports));