kill printstate when dht stops
This commit is contained in:
parent
c337973c0f
commit
ebc7373dc1
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue