Skip to content

Commit

Permalink
ignore error in job
Browse files Browse the repository at this point in the history
  • Loading branch information
magicalne committed Apr 20, 2022
1 parent 71a491e commit 2b1a21b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion agent/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,16 @@ def run(self):
LastBlockDetail = self.get_result.get_BlockDetail(
LastBlockHash["last_block_hash"])
if "-1" in LastBlockDetail.values():
print(LastBlockDetail)
print(f'LastBlockDetail: {LastBlockDetail}')
continue
else:
PreviousBlock_hash = self.get_result.get_block_hash(
hex((LastBlockDetail["blocknumber"]) - 1))
PreviousBlockDetail = self.get_result.get_BlockDetail(
PreviousBlock_hash["blocknumber_hash"])
if "-1" in PreviousBlockDetail.values():
print(f'PreviousBlockDetail: {PreviousBlockDetail}')
continue
LastBlock_Time = convert_int(
LastBlockDetail["blocknumber_timestamp"])
LastBlockTimestamp = LastBlock_Time
Expand Down Expand Up @@ -469,6 +473,8 @@ def exporter(block_number=None):
registry=registry,
)

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 2b1a21b

Please sign in to comment.