From 75f1289b5ece78ae14707d49296f8c503aec16db Mon Sep 17 00:00:00 2001 From: alessio Date: Tue, 23 Aug 2016 10:52:00 +0200 Subject: [PATCH] check run before closing the channel --- realize/watcher.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/realize/watcher.go b/realize/watcher.go index f9d90a7..6340373 100644 --- a/realize/watcher.go +++ b/realize/watcher.go @@ -126,8 +126,10 @@ func (p *Project) watching() { log.Println(pname(p.Name, 4), ":", Magenta(event.Name[:i])) // stop and run again - close(channel) - wr.Wait() + if p.Run { + close(channel) + wr.Wait() + } go routines(p, channel, &wr) p.reload = time.Now().Truncate(time.Second) }