Browse Source

[tm-monitor] fix blocking issue

as you can see the mistake is that we listen for quit instead of closing
it.
pull/1943/head
Anton Kaliaev 8 years ago
parent
commit
6e00ce9bbd
No known key found for this signature in database GPG Key ID: 7B6881D965918214
2 changed files with 3 additions and 7 deletions
  1. +2
    -1
      tm-monitor/eventmeter/eventmeter.go
  2. +1
    -6
      tm-monitor/monitor/node.go

+ 2
- 1
tm-monitor/eventmeter/eventmeter.go View File

@ -140,8 +140,9 @@ func (em *EventMeter) Start() error {
return nil return nil
} }
// Stop stops the EventMeter.
func (em *EventMeter) Stop() { func (em *EventMeter) Stop() {
<-em.quit
close(em.quit)
em.RegisterDisconnectCallback(nil) // so we don't try and reconnect em.RegisterDisconnectCallback(nil) // so we don't try and reconnect
em.wsc.Stop() // close(wsc.Quit) em.wsc.Stop() // close(wsc.Quit)


+ 1
- 6
tm-monitor/monitor/node.go View File

@ -121,12 +121,7 @@ func (n *Node) Start() error {
func (n *Node) Stop() { func (n *Node) Stop() {
n.Online = false n.Online = false
n.em.RegisterLatencyCallback(nil)
n.em.Unsubscribe(tmtypes.EventStringNewBlockHeader())
n.em.RegisterDisconnectCallback(nil)
// FIXME stop blocks at event_meter.go:140
// n.em.Stop()
n.em.Stop()
close(n.quit) close(n.quit)
} }


Loading…
Cancel
Save