Adding cmd line options

This commit is contained in:
=Corey Hulen
2015-09-04 11:59:10 -07:00
parent 05d95d80a8
commit 58d0d9afd2
11 changed files with 473 additions and 97 deletions

View File

@@ -35,6 +35,10 @@ func (s SqlTeamStore) CreateIndexesIfNotExists() {
}
func (s SqlTeamStore) Save(team *model.Team) StoreChannel {
return s.SaveWithValidate(team, true)
}
func (s SqlTeamStore) SaveWithValidate(team *model.Team, validate bool) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -49,10 +53,13 @@ func (s SqlTeamStore) Save(team *model.Team) StoreChannel {
}
team.PreSave()
if result.Err = team.IsValid(); result.Err != nil {
storeChannel <- result
close(storeChannel)
return
if validate {
if result.Err = team.IsValid(); result.Err != nil {
storeChannel <- result
close(storeChannel)
return
}
}
if err := s.GetMaster().Insert(team); err != nil {