Ignore missing txs, sync store on start

This commit is contained in:
lash 2022-04-10 15:30:08 +00:00
parent 01b674d09e
commit b5f513b63a
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
1 changed files with 6 additions and 2 deletions

View File

@ -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: