chainqueue

Blockchain transaction queue control
Log | Files | Refs | LICENSE

commit f7c09acfe2cabdd53aec9df2f997ee8a9646ab0c
parent 04d9901f0dabe2f0fcb7bfeee74dda63e6e1b531
Author: lash <dev@holbrook.no>
Date:   Sun,  1 May 2022 06:27:52 +0000

Add race delay

Diffstat:
Mchainqueue/store/base.py | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/chainqueue/store/base.py b/chainqueue/store/base.py @@ -2,6 +2,7 @@ import re import datetime import logging +import time # local imports from chainqueue.cache import CacheTx @@ -31,6 +32,8 @@ all_local_errors = all_errors() - StatusBits.NETWORK_ERROR re_u = r'^[^_][_A-Z]+$' class Store: + race_delay = 0.1 + def __init__(self, chain_spec, state_store, index_store, counter, cache=None): self.chain_spec = chain_spec self.cache = cache @@ -58,6 +61,7 @@ class Store: self.state_store.sync() except Exception as e: sync_err = e + time.sleep(self.race_delay) continue if sync_err != None: