kill printstate when dht stops

This commit is contained in:
Alex Grintsvayg 2018-04-05 16:39:05 -04:00
parent c337973c0f
commit ebc7373dc1

View file

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