MM-15288: Migrate CommandStore.Get to sync by default (#10739)
* MM-15288: Migrate Command.Get to sync by default * addressing review comments, updating status code of err returned by Get Method
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
fc15eda37f
Коммит
2d3fb4f426
@@ -686,11 +686,9 @@ func (a *App) HandleCommandWebhook(hookId string, response *model.CommandRespons
|
||||
hook = result.Data.(*model.CommandWebhook)
|
||||
}
|
||||
|
||||
var cmd *model.Command
|
||||
if result := <-a.Srv.Store.Command().Get(hook.CommandId); result.Err != nil {
|
||||
return model.NewAppError("HandleCommandWebhook", "web.command_webhook.command.app_error", nil, "err="+result.Err.Message, http.StatusBadRequest)
|
||||
} else {
|
||||
cmd = result.Data.(*model.Command)
|
||||
cmd, err := a.Srv.Store.Command().Get(hook.CommandId)
|
||||
if err != nil {
|
||||
return model.NewAppError("HandleCommandWebhook", "web.command_webhook.command.app_error", nil, "err="+err.Message, http.StatusBadRequest)
|
||||
}
|
||||
|
||||
args := &model.CommandArgs{
|
||||
@@ -705,6 +703,6 @@ func (a *App) HandleCommandWebhook(hookId string, response *model.CommandRespons
|
||||
return model.NewAppError("HandleCommandWebhook", "web.command_webhook.invalid.app_error", nil, "err="+result.Err.Message, result.Err.StatusCode)
|
||||
}
|
||||
|
||||
_, err := a.HandleCommandResponse(cmd, args, response, false)
|
||||
_, err = a.HandleCommandResponse(cmd, args, response, false)
|
||||
return err
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user