diff --git a/cmd/root.go b/cmd/root.go index a85e29bd22e365a805f608459b485418a5db898b..fe5b53e033a57bc1f6cb45be06b162d2d52f5c8c 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) }, }