mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Fix main goroutine
This commit is contained in:
+7
-3
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Start(stop chan int) {
|
||||
@@ -9,9 +10,12 @@ func Start(stop chan int) {
|
||||
go CopyMulty(in, Plugins.Outputs...)
|
||||
}
|
||||
|
||||
select {
|
||||
case <-stop:
|
||||
return
|
||||
for {
|
||||
select {
|
||||
case <-stop:
|
||||
return
|
||||
case <- time.After(1 * time.Second):
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user