[MM-15356] Migrate "Channel.Update" to Sync by default (#10815)
Этот коммит содержится в:
коммит произвёл
Hanzei
родитель
3bb11d747d
Коммит
b561d7900c
@@ -496,9 +496,9 @@ func (a *App) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError
|
||||
}
|
||||
|
||||
func (a *App) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) {
|
||||
result := <-a.Srv.Store.Channel().Update(channel)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
_, err := a.Srv.Store.Channel().Update(channel)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
a.InvalidateCacheForChannel(channel)
|
||||
@@ -1957,8 +1957,8 @@ func (a *App) MoveChannel(team *model.Team, channel *model.Channel, user *model.
|
||||
}
|
||||
|
||||
channel.TeamId = team.Id
|
||||
if result := <-a.Srv.Store.Channel().Update(channel); result.Err != nil {
|
||||
return result.Err
|
||||
if _, err := a.Srv.Store.Channel().Update(channel); err != nil {
|
||||
return err
|
||||
}
|
||||
a.postChannelMoveMessage(user, channel, previousTeam)
|
||||
|
||||
|
||||
@@ -1136,8 +1136,8 @@ func (a *App) ImportDirectChannel(data *DirectChannelImportData, dryRun bool) *m
|
||||
|
||||
if data.Header != nil {
|
||||
channel.Header = *data.Header
|
||||
if result := <-a.Srv.Store.Channel().Update(channel); result.Err != nil {
|
||||
return model.NewAppError("BulkImport", "app.import.import_direct_channel.update_header_failed.error", nil, result.Err.Error(), http.StatusBadRequest)
|
||||
if _, apperr := a.Srv.Store.Channel().Update(channel); apperr != nil {
|
||||
return model.NewAppError("BulkImport", "app.import.import_direct_channel.update_header_failed.error", nil, apperr.Error(), http.StatusBadRequest)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user