Log error on eth subscription resubscribe

This commit is contained in:
Martin Boehm 2019-05-07 12:23:50 +02:00
parent 2d3e7c9612
commit 7c4e8c5750

View File

@ -245,7 +245,7 @@ func (b *EthereumRPC) subscribe(f func() (*rpc.ClientSubscription, error)) error
return return
} }
glog.Error("Subscription error ", e) glog.Error("Subscription error ", e)
timer := time.NewTimer(time.Second) timer := time.NewTimer(time.Second * 2)
// try in 1 second interval to resubscribe // try in 1 second interval to resubscribe
for { for {
select { select {
@ -260,7 +260,8 @@ func (b *EthereumRPC) subscribe(f func() (*rpc.ClientSubscription, error)) error
s = ns s = ns
continue Loop continue Loop
} }
timer.Reset(time.Second) glog.Error("Resubscribe error ", e)
timer.Reset(time.Second * 2)
} }
} }
} }