forked from LBRYCommunity/lbry-sdk
fixed conflict with two cursors when one is reading and another is commiting
This commit is contained in:
parent
7d9bf03574
commit
34a9dff141
1 changed files with 18 additions and 18 deletions
|
@ -341,12 +341,11 @@ def process_claims(starting_height: int, blocks_added: Optional[Tuple[int, int]]
|
|||
).order_by(TXO.c.claim_hash)
|
||||
)
|
||||
|
||||
streaming_connection = p.ctx.connection.execution_options(stream_results=True)
|
||||
|
||||
with p.ctx.engine.connect().execution_options(stream_results=True) as c:
|
||||
# all channels need to be inserted first because channel short_url will needed to
|
||||
# set the contained claims canonical_urls when those are inserted next
|
||||
done = insert_claims_with_lbrycrd(
|
||||
done, chain, p, streaming_connection.execute(
|
||||
done, chain, p, c.execute(
|
||||
select_claims.select_from(TXO.join(TX)).where(
|
||||
(TXO.c.txo_type == TXO_TYPES['channel']) &
|
||||
(TXO.c.spent_height == 0) &
|
||||
|
@ -376,8 +375,9 @@ def process_claims(starting_height: int, blocks_added: Optional[Tuple[int, int]]
|
|||
)
|
||||
)
|
||||
|
||||
with p.ctx.engine.connect().execution_options(stream_results=True) as c:
|
||||
done = insert_claims_with_lbrycrd(
|
||||
done, chain, p, streaming_connection.execute(
|
||||
done, chain, p, c.execute(
|
||||
select_claims.where(
|
||||
(TXO.c.txo_type.in_(list(set(CLAIM_TYPE_CODES) - {TXO_TYPES['channel']}))) &
|
||||
(TXO.c.spent_height == 0) &
|
||||
|
|
Loading…
Add table
Reference in a new issue