mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-09-01 09:45:13 +00:00
create_task instead of ensure_future
This commit is contained in:
parent
11525c7d0d
commit
bc4075e2ed
1 changed files with 3 additions and 2 deletions
|
@ -497,14 +497,15 @@ class Ledger(metaclass=LedgerRegistry):
|
||||||
if not we_need:
|
if not we_need:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
cache_tasks: List[asyncio.Future[Transaction]] = []
|
cache_tasks: List[asyncio.Task[Transaction]] = []
|
||||||
synced_history = StringIO()
|
synced_history = StringIO()
|
||||||
|
loop = asyncio.get_running_loop()
|
||||||
for i, (txid, remote_height) in enumerate(remote_history):
|
for i, (txid, remote_height) in enumerate(remote_history):
|
||||||
if i < len(local_history) and local_history[i] == (txid, remote_height) and not cache_tasks:
|
if i < len(local_history) and local_history[i] == (txid, remote_height) and not cache_tasks:
|
||||||
synced_history.write(f'{txid}:{remote_height}:')
|
synced_history.write(f'{txid}:{remote_height}:')
|
||||||
else:
|
else:
|
||||||
check_local = (txid, remote_height) not in we_need
|
check_local = (txid, remote_height) not in we_need
|
||||||
cache_tasks.append(asyncio.ensure_future(
|
cache_tasks.append(loop.create_task(
|
||||||
self.cache_transaction(txid, remote_height, check_local=check_local)
|
self.cache_transaction(txid, remote_height, check_local=check_local)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue