mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Log error on unknown hook
This commit is contained in:
parent
e8f902c05c
commit
7663e55a2c
9 changed files with 85 additions and 56 deletions
|
@ -13,7 +13,7 @@ import { RegisterSettingOptions } from '../../../shared/models/plugins/register-
|
|||
import { RegisterHookOptions } from '../../../shared/models/plugins/register-hook.model'
|
||||
import { PluginSettingsManager } from '../../../shared/models/plugins/plugin-settings-manager.model'
|
||||
import { PluginStorageManager } from '../../../shared/models/plugins/plugin-storage-manager.model'
|
||||
import { ServerHook, ServerHookName } from '../../../shared/models/plugins/server-hook.model'
|
||||
import { ServerHook, ServerHookName, serverHookObject } from '../../../shared/models/plugins/server-hook.model'
|
||||
import { getHookType, internalRunHook } from '../../../shared/core-utils/plugins/hooks'
|
||||
import { RegisterOptions } from '../../typings/plugins/register-options.model'
|
||||
import { PluginLibrary } from '../../typings/plugins'
|
||||
|
@ -388,6 +388,11 @@ export class PluginManager implements ServerHook {
|
|||
|
||||
private getRegisterHelpers (npmName: string, plugin: PluginModel): RegisterOptions {
|
||||
const registerHook = (options: RegisterHookOptions) => {
|
||||
if (serverHookObject[options.target] !== true) {
|
||||
logger.warn('Unknown hook %s of plugin %s. Skipping.', options.target, npmName)
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.hooks[options.target]) this.hooks[options.target] = []
|
||||
|
||||
this.hooks[options.target].push({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue