kill printstate when dht stops
This commit is contained in:
parent
f5f47aa079
commit
0aa1ce7343
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