Check explicit for bool in filter interrupt check

This commit is contained in:
lash 2022-04-25 06:28:42 +00:00
parent 290fa1844d
commit 927913bd02
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 5 additions and 1 deletions

View File

@ -1,9 +1,12 @@
# standard imports
import uuid
import logging
# local imports
from chainsyncer.error import FilterDone
logg = logging.getLogger(__name__)
class SyncSession:
@ -29,6 +32,7 @@ class SyncSession:
def filter(self, conn, block, tx):
self.session_store.connect()
for fltr in self.filters:
logg.debug('executing filter {}'.format(fltr))
self.item.advance()
interrupt = fltr.filter(conn, block, tx)
if not self.item.release(interrupt=interrupt):

View File

@ -121,7 +121,7 @@ class SyncItem:
def release(self, interrupt=False):
if self.skip_filter:
return False
if interrupt:
if interrupt == True:
self.filter_state.unset(self.state_key, self.filter_state.from_name('LOCK'))
self.filter_state.set(self.state_key, self.filter_state.from_name('INTERRUPT'))
self.filter_state.set(self.state_key, self.filter_state.from_name('DONE'))