MM-15294: migrate commandstore.Update to sync by default (#10745)

* MM-15294: migrate commandstore.Update to sync by default

* minor change for code consistency
Этот коммит содержится в:
Puneeth Reddy
2019-04-29 07:22:44 -07:00
коммит произвёл Lev
родитель dec3c8facb
Коммит 5b70962f71
5 изменённых файлов: 33 добавлений и 35 удалений

Просмотреть файл

@@ -502,19 +502,15 @@ func (a *App) UpdateCommand(oldCmd, updatedCmd *model.Command) (*model.Command,
updatedCmd.CreatorId = oldCmd.CreatorId
updatedCmd.TeamId = oldCmd.TeamId
result := <-a.Srv.Store.Command().Update(updatedCmd)
if result.Err != nil {
return nil, result.Err
}
return result.Data.(*model.Command), nil
return a.Srv.Store.Command().Update(updatedCmd)
}
func (a *App) MoveCommand(team *model.Team, command *model.Command) *model.AppError {
command.TeamId = team.Id
result := <-a.Srv.Store.Command().Update(command)
if result.Err != nil {
return result.Err
_, err := a.Srv.Store.Command().Update(command)
if err != nil {
return err
}
return nil
@@ -527,12 +523,7 @@ func (a *App) RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppE
cmd.Token = model.NewId()
result := <-a.Srv.Store.Command().Update(cmd)
if result.Err != nil {
return nil, result.Err
}
return result.Data.(*model.Command), nil
return a.Srv.Store.Command().Update(cmd)
}
func (a *App) DeleteCommand(commandId string) *model.AppError {