Check explicit for bool in filter interrupt check
This commit is contained in:
parent
290fa1844d
commit
927913bd02
@ -1,9 +1,12 @@
|
|||||||
# standard imports
|
# standard imports
|
||||||
import uuid
|
import uuid
|
||||||
|
import logging
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from chainsyncer.error import FilterDone
|
from chainsyncer.error import FilterDone
|
||||||
|
|
||||||
|
logg = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SyncSession:
|
class SyncSession:
|
||||||
|
|
||||||
@ -29,6 +32,7 @@ class SyncSession:
|
|||||||
def filter(self, conn, block, tx):
|
def filter(self, conn, block, tx):
|
||||||
self.session_store.connect()
|
self.session_store.connect()
|
||||||
for fltr in self.filters:
|
for fltr in self.filters:
|
||||||
|
logg.debug('executing filter {}'.format(fltr))
|
||||||
self.item.advance()
|
self.item.advance()
|
||||||
interrupt = fltr.filter(conn, block, tx)
|
interrupt = fltr.filter(conn, block, tx)
|
||||||
if not self.item.release(interrupt=interrupt):
|
if not self.item.release(interrupt=interrupt):
|
||||||
|
@ -121,7 +121,7 @@ class SyncItem:
|
|||||||
def release(self, interrupt=False):
|
def release(self, interrupt=False):
|
||||||
if self.skip_filter:
|
if self.skip_filter:
|
||||||
return False
|
return False
|
||||||
if interrupt:
|
if interrupt == True:
|
||||||
self.filter_state.unset(self.state_key, self.filter_state.from_name('LOCK'))
|
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('INTERRUPT'))
|
||||||
self.filter_state.set(self.state_key, self.filter_state.from_name('DONE'))
|
self.filter_state.set(self.state_key, self.filter_state.from_name('DONE'))
|
||||||
|
Loading…
Reference in New Issue
Block a user