Support mattermost setup with up to 50k users

This commit is contained in:
Wim 2016-11-23 21:24:35 +01:00
parent 780ea6f7c0
commit 571f50d734

View File

@ -275,7 +275,7 @@ func (m *MMClient) parseActionPost(rmsg *Message) {
} }
func (m *MMClient) UpdateUsers() error { func (m *MMClient) UpdateUsers() error {
mmusers, err := m.Client.GetProfiles(0, 5000, "") mmusers, err := m.Client.GetProfiles(0, 50000, "")
if err != nil { if err != nil {
return errors.New(err.DetailedError) return errors.New(err.DetailedError)
} }
@ -621,7 +621,7 @@ func (m *MMClient) initUser() error {
//m.log.Debug("initUser(): loading all team data") //m.log.Debug("initUser(): loading all team data")
for _, v := range initData.Teams { for _, v := range initData.Teams {
m.Client.SetTeamId(v.Id) m.Client.SetTeamId(v.Id)
mmusers, _ := m.Client.GetProfiles(0, 5000, "") mmusers, _ := m.Client.GetProfiles(0, 50000, "")
t := &Team{Team: v, Users: mmusers.Data.(map[string]*model.User), Id: v.Id} t := &Team{Team: v, Users: mmusers.Data.(map[string]*model.User), Id: v.Id}
mmchannels, _ := m.Client.GetChannels("") mmchannels, _ := m.Client.GetChannels("")
t.Channels = mmchannels.Data.(*model.ChannelList) t.Channels = mmchannels.Data.(*model.ChannelList)