1
0
Fork 0

Re-open closed channels after stop

This commit is contained in:
Gregory Eremin 2016-07-19 17:30:40 +02:00
parent a1cf8bc689
commit e05c84027c
1 changed files with 6 additions and 0 deletions

View File

@ -125,9 +125,15 @@ func (s *Shezmu) StopDaemons() {
s.wgSystem.Wait() s.wgSystem.Wait()
close(s.shutdownWorkers) close(s.shutdownWorkers)
s.wgWorkers.Wait() s.wgWorkers.Wait()
close(s.queue) close(s.queue)
// Re-open closed channels to allow starting new deamons afterwards
s.shutdownSystem = make(chan struct{})
s.shutdownWorkers = make(chan struct{})
s.queue = make(chan *task)
fmt.Println(s.runtimeStats.Fetch(stats.Latency)) fmt.Println(s.runtimeStats.Fetch(stats.Latency))
} }