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
16
app/user.go
16
app/user.go
@@ -308,15 +308,13 @@ func (a *App) createUserOrGuest(c request.CTX, user *model.User, guest bool) (*m
|
||||
message.Add("user_id", ruser.Id)
|
||||
a.Publish(message)
|
||||
|
||||
if pluginsEnvironment := a.GetPluginsEnvironment(); pluginsEnvironment != nil {
|
||||
a.Srv().Go(func() {
|
||||
pluginContext := pluginContext(c)
|
||||
a.ch.RunMultiHook(func(hooks plugin.Hooks) bool {
|
||||
hooks.UserHasBeenCreated(pluginContext, ruser)
|
||||
return true
|
||||
}, plugin.UserHasBeenCreatedID)
|
||||
})
|
||||
}
|
||||
pluginContext := pluginContext(c)
|
||||
a.Srv().Go(func() {
|
||||
a.ch.RunMultiHook(func(hooks plugin.Hooks) bool {
|
||||
hooks.UserHasBeenCreated(pluginContext, ruser)
|
||||
return true
|
||||
}, plugin.UserHasBeenCreatedID)
|
||||
})
|
||||
|
||||
_, cwsErr := a.SendSubscriptionHistoryEvent(ruser.Id)
|
||||
if cwsErr != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user