diff --git a/server/helpers/decache.ts b/server/helpers/decache.ts index 08ab545e4..6be446ff6 100644 --- a/server/helpers/decache.ts +++ b/server/helpers/decache.ts @@ -3,16 +3,16 @@ import { extname } from 'path' -function decachePlugin (pluginPath: string, libraryPath: string) { +function decachePlugin (libraryPath: string) { const moduleName = find(libraryPath) if (!moduleName) return searchCache(moduleName, function (mod) { delete require.cache[mod.id] - }) - removeCachedPath(pluginPath) + removeCachedPath(mod.path) + }) } function decacheModule (name: string) { @@ -22,9 +22,9 @@ function decacheModule (name: string) { searchCache(moduleName, function (mod) { delete require.cache[mod.id] - }) - removeCachedPath(moduleName) + removeCachedPath(mod.path) + }) } // --------------------------------------------------------------------------- diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index 9086a4c8e..88c5b60d7 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts @@ -496,7 +496,7 @@ export class PluginManager implements ServerHook { // Delete cache if needed const modulePath = join(pluginPath, packageJSON.library) - decachePlugin(pluginPath, modulePath) + decachePlugin(modulePath) const library: PluginLibrary = require(modulePath) if (!isLibraryCodeValid(library)) {