mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-09 20:19:50 +00:00
synchronizer: offload cpu-heavy address generation to other thread
This commit is contained in:
parent
172ddf4aaf
commit
1294608571
1 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
from aiorpcx import TaskGroup
|
from aiorpcx import TaskGroup, run_in_thread
|
||||||
|
|
||||||
from .transaction import Transaction
|
from .transaction import Transaction
|
||||||
from .util import bh2u, PrintError
|
from .util import bh2u, PrintError
|
||||||
|
@ -180,7 +180,7 @@ class Synchronizer(PrintError):
|
||||||
# main loop
|
# main loop
|
||||||
while True:
|
while True:
|
||||||
await asyncio.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
self.wallet.synchronize()
|
await run_in_thread(self.wallet.synchronize)
|
||||||
up_to_date = self.is_up_to_date()
|
up_to_date = self.is_up_to_date()
|
||||||
if (up_to_date != self.wallet.is_up_to_date()
|
if (up_to_date != self.wallet.is_up_to_date()
|
||||||
or up_to_date and self._processed_some_notifications):
|
or up_to_date and self._processed_some_notifications):
|
||||||
|
|
Loading…
Add table
Reference in a new issue