Skip to content
Snippets Groups Projects
Commit 2a5e71ab authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Move timeout timer creation to inside the for loop, so it is reset each time...

Move timeout timer creation to inside the for loop, so it is reset each time instead of acting as a program runtime timeout
parent dd505301
No related branches found
No related tags found
No related merge requests found
...@@ -197,9 +197,9 @@ var rootCmd = &cobra.Command{ ...@@ -197,9 +197,9 @@ var rootCmd = &cobra.Command{
receiveCnt := uint(0) receiveCnt := uint(0)
waitSecs := viper.GetUint("waitTimeout") waitSecs := viper.GetUint("waitTimeout")
waitTimeout := time.Duration(waitSecs) waitTimeout := time.Duration(waitSecs)
timeoutTimer := time.NewTimer(waitTimeout * time.Second)
done := false done := false
for !done && expectedCnt != 0 { for !done && expectedCnt != 0 {
timeoutTimer := time.NewTimer(waitTimeout * time.Second)
select { select {
case <-timeoutTimer.C: case <-timeoutTimer.C:
fmt.Println("Timed out!") fmt.Println("Timed out!")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment