From 24a792404cac0dffff91853af33310fbb7a30297 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Apr 2021 16:02:15 +0200 Subject: Support async onSettingsChange --- server/lib/plugins/plugin-manager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/lib/plugins/plugin-manager.ts') diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index 03ea48416..f3766ffa8 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts @@ -189,7 +189,7 @@ export class PluginManager implements ServerHook { return undefined } - onSettingsChanged (name: string, settings: any) { + async onSettingsChanged (name: string, settings: any) { const registered = this.getRegisteredPluginByShortName(name) if (!registered) { logger.error('Cannot find plugin %s to call on settings changed.', name) @@ -197,7 +197,7 @@ export class PluginManager implements ServerHook { for (const cb of registered.registerHelpers.getOnSettingsChangedCallbacks()) { try { - cb(settings) + await cb(settings) } catch (err) { logger.error('Cannot run on settings changed callback for %s.', registered.npmName, { err }) } -- cgit v1.2.3