commit 3a8ec0158887ce494f604dfe2600606300a1694b
parent b63793fd9b34cb8801a62ccd9c4ec1e8735779a9
Author: lash <dev@holbrook.no>
Date:   Wed,  4 May 2022 05:44:47 +0000
Allow for sync skip in queue store instantiation
Diffstat:
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/chainqueue/store/base.py b/chainqueue/store/base.py
@@ -29,7 +29,7 @@ all_local_errors = all_errors() - StatusBits.NETWORK_ERROR
 re_u = r'^[^_][_A-Z]+$'
 class Store:
 
-    def __init__(self, chain_spec, state_store, index_store, counter, cache=None):
+    def __init__(self, chain_spec, state_store, index_store, counter, cache=None, sync=True):
         self.chain_spec = chain_spec
         self.cache = cache
         self.state_store = state_store
@@ -51,6 +51,9 @@ class Store:
                 ]:
             setattr(self, v, getattr(self.state_store, v))
 
+        if not sync:
+            return
+
         sync_err = None
         try:
             self.state_store.sync()
@@ -106,10 +109,12 @@ class Store:
                 if item_state & state != item_state:
                     continue
 
-            logg.info('state {} {}'.format(ref, item_state))
             if item_state & not_state > 0:
                 continue
 
+            item_state_str = self.state_store.name(item_state)
+            logg.info('state {} {} ({})'.format(ref, item_state_str, item_state))
+
             if threshold != None:
                 v = self.state_store.modified(ref)
                 if v > threshold:
diff --git a/setup.cfg b/setup.cfg
@@ -1,6 +1,6 @@
 [metadata]
 name = chainqueue
-version = 0.1.9
+version = 0.1.10
 description = Generic blockchain transaction queue control
 author = Louis Holbrook
 author_email = dev@holbrook.no