From 758995d8f57af3d98da97ee1c005ea9252d56991 Mon Sep 17 00:00:00 2001 From: Leonid Bugaev Date: Thu, 9 Oct 2014 23:16:56 +0400 Subject: [PATCH] Fix main goroutine --- emitter.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/emitter.go b/emitter.go index 6f631b0..a8f0ae3 100644 --- a/emitter.go +++ b/emitter.go @@ -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): + } } }