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/channel.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmd/commands/channel.go') diff --git a/cmd/commands/channel.go b/cmd/commands/channel.go index d7b48f04c..30d4e53ec 100644 --- a/cmd/commands/channel.go +++ b/cmd/commands/channel.go @@ -136,6 +136,7 @@ func createChannelCmdF(command *cobra.Command, args []string) error { if err != nil { return err } + defer a.Shutdown() name, errn := command.Flags().GetString("name") if errn != nil || name == "" { @@ -185,6 +186,7 @@ func removeChannelUsersCmdF(command *cobra.Command, args []string) error { if err != nil { return err } + defer a.Shutdown() if len(args) < 2 { return errors.New("Not enough arguments.") @@ -218,6 +220,7 @@ func addChannelUsersCmdF(command *cobra.Command, args []string) error { if err != nil { return err } + defer a.Shutdown() if len(args) < 2 { return errors.New("Not enough arguments.") @@ -251,6 +254,7 @@ func archiveChannelsCmdF(command *cobra.Command, args []string) error { if err != nil { return err } + defer a.Shutdown() if len(args) < 1 { return errors.New("Enter at least one channel to archive.") @@ -275,6 +279,7 @@ func deleteChannelsCmdF(command *cobra.Command, args []string) error { if err != nil { return err } + defer a.Shutdown() if len(args) < 1 { return errors.New("Enter at least one channel to delete.") @@ -315,6 +320,7 @@ func moveChannelsCmdF(command *cobra.Command, args []string) error { if err != nil { return err } + defer a.Shutdown() if len(args) < 2 { return errors.New("Enter the destination team and at least one channel to move.") @@ -389,6 +395,7 @@ func listChannelsCmdF(command *cobra.Command, args []string) error { if err != nil { return err } + defer a.Shutdown() if len(args) < 1 { return errors.New("Enter at least one team.") @@ -423,6 +430,7 @@ func restoreChannelsCmdF(command *cobra.Command, args []string) error { if err != nil { return err } + defer a.Shutdown() if len(args) < 1 { return errors.New("Enter at least one channel.") @@ -447,6 +455,7 @@ func modifyChannelCmdF(command *cobra.Command, args []string) error { if err != nil { return err } + defer a.Shutdown() if len(args) != 1 { return errors.New("Enter at one channel to modify.") -- cgit v1.2.3-1-g7c22