Re-open closed channels after stop
This commit is contained in:
parent
a1cf8bc689
commit
e05c84027c
|
@ -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))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue