kill printstate when dht stops

This commit is contained in:
Alex Grintsvayg 2018-04-05 16:39:05 -04:00
parent f5f47aa079
commit 0aa1ce7343

View file

@ -168,7 +168,11 @@ func (dht *DHT) init() error {
t := time.NewTicker(dht.conf.PrintState) t := time.NewTicker(dht.conf.PrintState)
for { for {
dht.PrintState() dht.PrintState()
<-t.C select {
case <-t.C:
case <-dht.stop.Chan():
return
}
} }
}() }()
} }