diff --git a/lbry/wallet/server/block_processor.py b/lbry/wallet/server/block_processor.py index 33cec22c7..e948bc67c 100644 --- a/lbry/wallet/server/block_processor.py +++ b/lbry/wallet/server/block_processor.py @@ -1682,6 +1682,7 @@ class BlockProcessor: def run(self): loop = asyncio.get_event_loop() + loop.set_default_executor(self._chain_executor) def __exit(): raise SystemExit() diff --git a/lbry/wallet/server/chain_reader.py b/lbry/wallet/server/chain_reader.py index c845766c7..6d3229c1b 100644 --- a/lbry/wallet/server/chain_reader.py +++ b/lbry/wallet/server/chain_reader.py @@ -265,6 +265,7 @@ class BlockchainReaderServer(BlockchainReader): def run(self): loop = asyncio.get_event_loop() + loop.set_default_executor(self._executor) def __exit(): raise SystemExit() diff --git a/lbry/wallet/server/db/db.py b/lbry/wallet/server/db/db.py index 6e5ccc90e..26937f60a 100644 --- a/lbry/wallet/server/db/db.py +++ b/lbry/wallet/server/db/db.py @@ -348,7 +348,7 @@ class HubDB: async def fs_getclaimbyid(self, claim_id): return await asyncio.get_event_loop().run_in_executor( - None, self._fs_get_claim_by_hash, bytes.fromhex(claim_id) + self._executor, self._fs_get_claim_by_hash, bytes.fromhex(claim_id) ) def get_claim_txo_amount(self, claim_hash: bytes) -> Optional[int]: @@ -967,7 +967,7 @@ class HubDB: tx_infos = {} for tx_hash in tx_hashes: tx_infos[tx_hash] = await asyncio.get_event_loop().run_in_executor( - None, self._get_transaction_and_merkle, tx_hash + self._executor, self._get_transaction_and_merkle, tx_hash ) await asyncio.sleep(0) return tx_infos diff --git a/lbry/wallet/server/db/elasticsearch/sync.py b/lbry/wallet/server/db/elasticsearch/sync.py index 78107c789..070db8270 100644 --- a/lbry/wallet/server/db/elasticsearch/sync.py +++ b/lbry/wallet/server/db/elasticsearch/sync.py @@ -345,6 +345,7 @@ class ElasticWriter(BlockchainReader): def run(self, reindex=False): loop = asyncio.get_event_loop() + loop.set_default_executor(self._executor) def __exit(): raise SystemExit()