summaryrefslogtreecommitdiffstats
path: root/cmd/commands/team.go
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2018-04-17 17:06:55 +0200
committerJoram Wilander <jwawilander@gmail.com>2018-04-17 11:06:55 -0400
commit51a6e95f58abd65b454e365d45a510eefd84bfe3 (patch)
treef591a340e446f4b96baf4774957ab43895949811 /cmd/commands/team.go
parent5511106d93a16626290763e8772b8b562f22100d (diff)
downloadchat-51a6e95f58abd65b454e365d45a510eefd84bfe3.tar.gz
chat-51a6e95f58abd65b454e365d45a510eefd84bfe3.tar.bz2
chat-51a6e95f58abd65b454e365d45a510eefd84bfe3.zip
add app shutdown to make sure the goroutines finish and all process are closed (#8629)
* run the send email verification as goroutine as well * add app shutdown to make sure all go routines finish
Diffstat (limited to 'cmd/commands/team.go')
-rw-r--r--cmd/commands/team.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/commands/team.go b/cmd/commands/team.go
index 05de714d6..7dcf48847 100644
--- a/cmd/commands/team.go
+++ b/cmd/commands/team.go
@@ -83,6 +83,7 @@ func createTeamCmdF(command *cobra.Command, args []string) error {
if err != nil {
return err
}
+ defer a.Shutdown()
name, errn := command.Flags().GetString("name")
if errn != nil || name == "" {
@@ -119,6 +120,7 @@ func removeUsersCmdF(command *cobra.Command, args []string) error {
if err != nil {
return err
}
+ defer a.Shutdown()
if len(args) < 2 {
return errors.New("Not enough arguments.")
@@ -152,6 +154,7 @@ func addUsersCmdF(command *cobra.Command, args []string) error {
if err != nil {
return err
}
+ defer a.Shutdown()
if len(args) < 2 {
return errors.New("Not enough arguments.")
@@ -185,6 +188,7 @@ func deleteTeamsCmdF(command *cobra.Command, args []string) error {
if err != nil {
return err
}
+ defer a.Shutdown()
if len(args) < 1 {
return errors.New("Not enough arguments.")
@@ -231,6 +235,7 @@ func listTeamsCmdF(command *cobra.Command, args []string) error {
if err != nil {
return err
}
+ defer a.Shutdown()
teams, err2 := a.GetAllTeams()
if err2 != nil {