From f7c09acfe2cabdd53aec9df2f997ee8a9646ab0c Mon Sep 17 00:00:00 2001 From: lash Date: Sun, 1 May 2022 06:27:52 +0000 Subject: [PATCH] Add race delay --- chainqueue/store/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chainqueue/store/base.py b/chainqueue/store/base.py index 124af03..44704a9 100644 --- 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: