aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-manager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/plugins/plugin-manager.ts')
-rw-r--r--server/lib/plugins/plugin-manager.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts
index d4d2a7edc..8add72a85 100644
--- a/server/lib/plugins/plugin-manager.ts
+++ b/server/lib/plugins/plugin-manager.ts
@@ -1,8 +1,8 @@
1import decache from 'decache'
2import express from 'express' 1import express from 'express'
3import { createReadStream, createWriteStream } from 'fs' 2import { createReadStream, createWriteStream } from 'fs'
4import { ensureDir, outputFile, readJSON } from 'fs-extra' 3import { ensureDir, outputFile, readJSON } from 'fs-extra'
5import { basename, join } from 'path' 4import { basename, join } from 'path'
5import { decachePlugin } from '@server/helpers/decache'
6import { MOAuthTokenUser, MUser } from '@server/types/models' 6import { MOAuthTokenUser, MUser } from '@server/types/models'
7import { getCompleteLocale } from '@shared/core-utils' 7import { getCompleteLocale } from '@shared/core-utils'
8import { ClientScript, PluginPackageJson, PluginTranslation, PluginTranslationPaths, RegisterServerHookOptions } from '@shared/models' 8import { ClientScript, PluginPackageJson, PluginTranslation, PluginTranslationPaths, RegisterServerHookOptions } from '@shared/models'
@@ -312,12 +312,12 @@ export class PluginManager implements ServerHook {
312 logger.error('Cannot install plugin %s, removing it...', toInstall, { err: rootErr }) 312 logger.error('Cannot install plugin %s, removing it...', toInstall, { err: rootErr })
313 313
314 try { 314 try {
315 await this.uninstall(npmName) 315 // await this.uninstall(npmName)
316 } catch (err) { 316 } catch (err) {
317 logger.error('Cannot uninstall plugin %s after failed installation.', toInstall, { err }) 317 logger.error('Cannot uninstall plugin %s after failed installation.', toInstall, { err })
318 318
319 try { 319 try {
320 await removeNpmPlugin(npmName) 320 // await removeNpmPlugin(npmName)
321 } catch (err) { 321 } catch (err) {
322 logger.error('Cannot remove plugin %s after failed installation.', toInstall, { err }) 322 logger.error('Cannot remove plugin %s after failed installation.', toInstall, { err })
323 } 323 }
@@ -420,7 +420,7 @@ export class PluginManager implements ServerHook {
420 420
421 // Delete cache if needed 421 // Delete cache if needed
422 const modulePath = join(pluginPath, packageJSON.library) 422 const modulePath = join(pluginPath, packageJSON.library)
423 decache(modulePath) 423 decachePlugin(pluginPath, modulePath)
424 const library: PluginLibrary = require(modulePath) 424 const library: PluginLibrary = require(modulePath)
425 425
426 if (!isLibraryCodeValid(library)) { 426 if (!isLibraryCodeValid(library)) {