Increasing channel limits (#4003)
* Increasing channel limits * Fixing unit test
Этот коммит содержится в:
@@ -155,7 +155,7 @@ func (s SqlChannelStore) saveChannelT(transaction *gorp.Transaction, channel *mo
|
||||
if count, err := transaction.SelectInt("SELECT COUNT(0) FROM Channels WHERE TeamId = :TeamId AND DeleteAt = 0 AND (Type = 'O' OR Type = 'P')", map[string]interface{}{"TeamId": channel.TeamId}); err != nil {
|
||||
result.Err = model.NewLocAppError("SqlChannelStore.Save", "store.sql_channel.save_channel.current_count.app_error", nil, "teamId="+channel.TeamId+", "+err.Error())
|
||||
return result
|
||||
} else if count > 1000 {
|
||||
} else if count > 20000 {
|
||||
result.Err = model.NewLocAppError("SqlChannelStore.Save", "store.sql_channel.save_channel.limit.app_error", nil, "teamId="+channel.TeamId)
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -39,21 +39,6 @@ func TestChannelStoreSave(t *testing.T) {
|
||||
if err := (<-store.Channel().Save(&o1)).Err; err == nil {
|
||||
t.Fatal("Should not be able to save direct channel")
|
||||
}
|
||||
|
||||
o1.Type = model.CHANNEL_OPEN
|
||||
for i := 0; i < 1000; i++ {
|
||||
o1.Id = ""
|
||||
o1.Name = "a" + model.NewId() + "b"
|
||||
if err := (<-store.Channel().Save(&o1)).Err; err != nil {
|
||||
t.Fatal("couldn't save item", err)
|
||||
}
|
||||
}
|
||||
|
||||
o1.Id = ""
|
||||
o1.Name = "a" + model.NewId() + "b"
|
||||
if err := (<-store.Channel().Save(&o1)).Err; err == nil {
|
||||
t.Fatal("should be the limit")
|
||||
}
|
||||
}
|
||||
|
||||
func TestChannelStoreSaveDirectChannel(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user