Skip to content

Commit

Permalink
Update run_node_processing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
f33r0 authored Oct 12, 2024
1 parent 2ce8686 commit 37a9ee1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions run_node_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@

SWAP_FEE_ASSETS = {}

# BLOCK_IMPORT_LIMIT = 5 # In blocks, 0, None or float("inf") - to not stop
BLOCK_IMPORT_LIMIT = 10 # In blocks, 0, None or float("inf") - to not stop

# WAIT_FOR_NEXT_IMPORT = 5 # In seconds
WAIT_FOR_NEXT_IMPORT = 4 # In seconds

def get_fee_price_func(substrate, block_hash, pairs):
xor_id_int = int(XOR_ID, 16)
Expand Down Expand Up @@ -307,11 +307,11 @@ def get_end(substrate: SubstrateInterface):
for block in (range if silent or not sys.stdout.isatty() else trange)(
begin, end
):
# if BLOCK_IMPORT_LIMIT != 0 and BLOCK_IMPORT_LIMIT is not None:
# if (block - begin + 1) % BLOCK_IMPORT_LIMIT == 0:
# logging.info("Waiting %i seconds to get next block", WAIT_FOR_NEXT_IMPORT)
# await asyncio.sleep(WAIT_FOR_NEXT_IMPORT)
# get events from <block> to <dataset>
if BLOCK_IMPORT_LIMIT != 0 and BLOCK_IMPORT_LIMIT is not None:
if (block - begin + 1) % BLOCK_IMPORT_LIMIT == 0:
logging.info("Waiting %i seconds to get next block", WAIT_FOR_NEXT_IMPORT)
await asyncio.sleep(WAIT_FOR_NEXT_IMPORT)
get events from <block> to <dataset>
dataset = []
try:
block_hash, events, res, grouped_events = get_events_from_block(
Expand Down

0 comments on commit 37a9ee1

Please sign in to comment.