commit b5f513b63a14821fc1130979abf0ed0fd410e393
parent 01b674d09ec0a0b2392a5389fc606c70446a0d53
Author: lash <dev@holbrook.no>
Date: Sun, 10 Apr 2022 15:30:08 +0000
Ignore missing txs, sync store on start
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/chainqueue/store/base.py b/chainqueue/store/base.py
@@ -6,6 +6,7 @@ import logging
# local imports
from chainqueue.cache import CacheTx
from chainqueue.entry import QueueEntry
+from chainqueue.error import NotLocalTxError
logg = logging.getLogger(__name__)
@@ -42,6 +43,7 @@ class Store:
'modified',
]:
setattr(self, v, getattr(self.state_store, v))
+ self.state_store.sync()
def put(self, v, cache_adapter=CacheTx):
@@ -59,7 +61,10 @@ class Store:
def get(self, k):
- s = self.index_store.get(k)
+ try:
+ s = self.index_store.get(k)
+ except FileNotFoundError:
+ raise NotLocalTxError(k)
v = self.state_store.get(s)
return (s, v,)
@@ -128,7 +133,6 @@ class Store:
def final(self, k, block, tx, error=False):
entry = QueueEntry(self, k)
entry.load()
- logg.debug('entry {} {}'.format(k, entry.k))
if error:
entry.fail(block, tx)
else: