app: avoid plugin env check for RunMultiHook and use pluginslock while accessing plugin env (#21803)
* app/channels: use pluginslock while accessing plugins environment * when using RunMultiHook we don't need to do a nil check on plugin env * trigger ci
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
03a5b4a288
Коммит
617c024476
@@ -286,14 +286,13 @@ func (ch *Channels) initPlugins(c *request.Context, pluginDir, webappPluginDir s
|
||||
ch.installFeatureFlagPlugins()
|
||||
ch.syncPluginsActiveState()
|
||||
}
|
||||
if pluginsEnvironment := ch.GetPluginsEnvironment(); pluginsEnvironment != nil {
|
||||
ch.RunMultiHook(func(hooks plugin.Hooks) bool {
|
||||
if err := hooks.OnConfigurationChange(); err != nil {
|
||||
ch.srv.Log().Error("Plugin OnConfigurationChange hook failed", mlog.Err(err))
|
||||
}
|
||||
return true
|
||||
}, plugin.OnConfigurationChangeID)
|
||||
}
|
||||
|
||||
ch.RunMultiHook(func(hooks plugin.Hooks) bool {
|
||||
if err := hooks.OnConfigurationChange(); err != nil {
|
||||
ch.srv.Log().Error("Plugin OnConfigurationChange hook failed", mlog.Err(err))
|
||||
}
|
||||
return true
|
||||
}, plugin.OnConfigurationChangeID)
|
||||
})
|
||||
ch.pluginsLock.Unlock()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user