parent
f3166176ce
commit
6f43910f2d
@ -116,7 +116,7 @@ class Daemon(object):
|
|||||||
nonlocal last_error_log, retry
|
nonlocal last_error_log, retry
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if now - last_error_log > 60:
|
if now - last_error_log > 60:
|
||||||
last_error_time = now
|
last_error_log = now
|
||||||
self.logger.error(f'{error} Retrying occasionally...')
|
self.logger.error(f'{error} Retrying occasionally...')
|
||||||
if retry == self.max_retry and self.failover():
|
if retry == self.max_retry and self.failover():
|
||||||
retry = 0
|
retry = 0
|
||||||
|
|||||||
@ -487,6 +487,6 @@ async def test_failover(daemon, caplog):
|
|||||||
with ClientSessionFailover(('getblockcount', [], height)):
|
with ClientSessionFailover(('getblockcount', [], height)):
|
||||||
await daemon.height() == height
|
await daemon.height() == height
|
||||||
|
|
||||||
assert in_caplog(caplog, "disconnected", 3)
|
assert in_caplog(caplog, "disconnected", 1)
|
||||||
assert in_caplog(caplog, "failing over")
|
assert in_caplog(caplog, "failing over")
|
||||||
assert in_caplog(caplog, "connection restored")
|
assert in_caplog(caplog, "connection restored")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user