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
No known key found for this signature in database
GPG Key ID: 7B6881D965918214
2 changed files with
3 additions and
7 deletions
-
tm-monitor/eventmeter/eventmeter.go
-
tm-monitor/monitor/node.go
|
|
@ -140,8 +140,9 @@ func (em *EventMeter) Start() error { |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
// Stop stops the EventMeter.
|
|
|
|
func (em *EventMeter) Stop() { |
|
|
|
<-em.quit |
|
|
|
close(em.quit) |
|
|
|
|
|
|
|
em.RegisterDisconnectCallback(nil) // so we don't try and reconnect
|
|
|
|
em.wsc.Stop() // close(wsc.Quit)
|
|
|
|
|
|
@ -121,12 +121,7 @@ func (n *Node) Start() error { |
|
|
|
func (n *Node) Stop() { |
|
|
|
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) |
|
|
|
} |
|
|
|