aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-manager.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-20 16:02:15 +0200
committerChocobozzz <me@florianbigard.com>2021-04-20 16:02:15 +0200
commit24a792404cac0dffff91853af33310fbb7a30297 (patch)
tree997f771146fe57527ca50a2d6e18febbc9baf124 /server/lib/plugins/plugin-manager.ts
parent51b66ea7cb39f075f4deb8ea92ba70f3be289769 (diff)
downloadPeerTube-24a792404cac0dffff91853af33310fbb7a30297.tar.gz
PeerTube-24a792404cac0dffff91853af33310fbb7a30297.tar.zst
PeerTube-24a792404cac0dffff91853af33310fbb7a30297.zip
Support async onSettingsChange
Diffstat (limited to 'server/lib/plugins/plugin-manager.ts')
-rw-r--r--server/lib/plugins/plugin-manager.ts4
1 files changed, 2 insertions, 2 deletions
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 {
189 return undefined 189 return undefined
190 } 190 }
191 191
192 onSettingsChanged (name: string, settings: any) { 192 async onSettingsChanged (name: string, settings: any) {
193 const registered = this.getRegisteredPluginByShortName(name) 193 const registered = this.getRegisteredPluginByShortName(name)
194 if (!registered) { 194 if (!registered) {
195 logger.error('Cannot find plugin %s to call on settings changed.', name) 195 logger.error('Cannot find plugin %s to call on settings changed.', name)
@@ -197,7 +197,7 @@ export class PluginManager implements ServerHook {
197 197
198 for (const cb of registered.registerHelpers.getOnSettingsChangedCallbacks()) { 198 for (const cb of registered.registerHelpers.getOnSettingsChangedCallbacks()) {
199 try { 199 try {
200 cb(settings) 200 await cb(settings)
201 } catch (err) { 201 } catch (err) {
202 logger.error('Cannot run on settings changed callback for %s.', registered.npmName, { err }) 202 logger.error('Cannot run on settings changed callback for %s.', registered.npmName, { err })
203 } 203 }