Skip to content

Commit

Permalink
ignore error when get tip
Browse files Browse the repository at this point in the history
  • Loading branch information
magicalne committed Apr 20, 2022
1 parent 2b1a21b commit f9d7546
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions agent/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ def run(self):
sleep(2)
logging.info("Start running")
if BlockNumber is None:
LastBlockNumber = self.gw_rpc.get_tip_number()
try:
LastBlockNumber = self.gw_rpc.get_tip_number()
except:
logging.exception("Cannot get tip number")
continue
else:
LastBlockNumber = BlockNumber

Expand Down Expand Up @@ -474,7 +478,6 @@ def exporter(block_number=None):
)

global LastBlockNumber
print(LastBlockNumber)
last_block_number.labels(web3_url=web3_url).set(LastBlockNumber)

node_gw_ping.labels(web3_url=web3_url,
Expand Down

0 comments on commit f9d7546

Please sign in to comment.