From 5c5a5891b383ad68e98b799aa3489b37ff80ecef Mon Sep 17 00:00:00 2001 From: "Richard T. Carback III" <rick.carback@gmail.com> Date: Wed, 16 Dec 2020 01:55:54 +0000 Subject: [PATCH] Stop network followers, and don't check for messages when you do not expect any --- cmd/root.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index a85e29bd2..fe5b53e03 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -188,7 +188,7 @@ var rootCmd = &cobra.Command{ waitTimeout := time.Duration(viper.GetUint("waitTimeout")) timeoutTimer := time.NewTimer(waitTimeout * time.Second) done := false - for !done { + for !done && expectedCnt != 0 { select { case <-timeoutTimer.C: fmt.Println("Timed out!") @@ -206,6 +206,7 @@ var rootCmd = &cobra.Command{ } } fmt.Printf("Received %d\n", receiveCnt) + client.StopNetworkFollower(1 * time.Second) }, } -- GitLab