Skip to content

Commit 736deb7

Browse files
authored
Increase graphs timeouts, small refactoring (#106)
Signed-off-by: cyc60 <[email protected]> Signed-off-by: cyc60 <[email protected]>
1 parent 025af94 commit 736deb7

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

oracle/oracle/common/clients.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
logger = logging.getLogger(__name__)
1717

1818

19-
# set default GQL query execution timeout to 30 seconds
20-
EXECUTE_TIMEOUT = 30
19+
# set default GQL query execution timeout to 45 seconds
20+
EXECUTE_TIMEOUT = 45
2121

2222
# set default GQL pagination
2323
PAGINATION_WINDOWS = 1000

oracle/oracle/main.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,13 @@ async def process_network(
115115
current_timestamp = finalized_block["timestamp"]
116116

117117
latest_block_number = await get_latest_block_number(NETWORK)
118-
119-
while not (await has_synced_block(NETWORK, latest_block_number)):
118+
graphs_synced = await has_synced_block(NETWORK, latest_block_number)
119+
if not graphs_synced:
120120
continue
121121

122122
voting_parameters = await get_voting_parameters(
123123
NETWORK, current_block_number
124124
)
125-
# there is no consensus
126-
if not voting_parameters:
127-
return
128125

129126
await asyncio.gather(
130127
# check and update staking rewards
@@ -143,8 +140,8 @@ async def process_network(
143140
)
144141
except BaseException as e:
145142
logger.exception(e)
146-
147-
await asyncio.sleep(ORACLE_PROCESS_INTERVAL)
143+
finally:
144+
await asyncio.sleep(ORACLE_PROCESS_INTERVAL)
148145

149146

150147
if __name__ == "__main__":

0 commit comments

Comments
 (0)