From 51a6e95f58abd65b454e365d45a510eefd84bfe3 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Tue, 17 Apr 2018 17:06:55 +0200 Subject: 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 --- cmd/commands/team.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd/commands/team.go') 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 { -- cgit v1.2.3-1-g7c22