MM-15801 Migrate "Session.UpdateRoles" to Sync by default (#11015)

Этот коммит содержится в:
Bolarinwa Balogun
2019-06-12 14:45:47 -04:00
коммит произвёл Hanzei
родитель 7b9833405d
Коммит 58e126b910
4 изменённых файлов: 29 добавлений и 16 удалений

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

@@ -1390,7 +1390,13 @@ func (a *App) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent
uchan <- store.StoreResult{Data: userUpdate, Err: err}
close(uchan)
}()
schan := a.Srv.Store.Session().UpdateRoles(user.Id, newRoles)
schan := make(chan store.StoreResult, 1)
go func() {
userId, err := a.Srv.Store.Session().UpdateRoles(user.Id, newRoles)
schan <- store.StoreResult{Data: userId, Err: err}
close(schan)
}()
result := <-uchan
if result.Err != nil {