From b83360f3e2747e6525713cf0b20bf69382df6edd Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Mon, 21 Feb 2022 15:26:14 -0500 Subject: [PATCH] executors --- lbry/wallet/server/mempool.py | 4 ++-- lbry/wallet/server/session.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lbry/wallet/server/mempool.py b/lbry/wallet/server/mempool.py index 720214361..c5181cfb4 100644 --- a/lbry/wallet/server/mempool.py +++ b/lbry/wallet/server/mempool.py @@ -62,7 +62,7 @@ class MemPool: def refresh(self) -> typing.Set[bytes]: # returns list of new touched hashXs prefix_db = self._db.prefix_db - new_mempool = {k.tx_hash: v.raw_tx for k, v in prefix_db.mempool_tx.iterate()} + new_mempool = {k.tx_hash: v.raw_tx for k, v in prefix_db.mempool_tx.iterate()} # TODO: make this more efficient self.raw_mempool.clear() self.raw_mempool.update(new_mempool) @@ -187,7 +187,7 @@ class MemPool: self.session_manager.mempool_statuses.pop(hashX, None) # self.bp._chain_executor await asyncio.get_event_loop().run_in_executor( - None, touched.intersection_update, self.session_manager.hashx_subscriptions_by_session.keys() + self._db._executor, touched.intersection_update, self.session_manager.hashx_subscriptions_by_session.keys() ) if touched or new_touched or (height_changed and self.session_manager.mempool_statuses): diff --git a/lbry/wallet/server/session.py b/lbry/wallet/server/session.py index fac876b72..5aeba99cc 100644 --- a/lbry/wallet/server/session.py +++ b/lbry/wallet/server/session.py @@ -984,7 +984,7 @@ class LBRYElectrumX(SessionBase): async def _cached_resolve_url(self, url): if url not in self.session_manager.resolve_cache: - self.session_manager.resolve_cache[url] = await self.loop.run_in_executor(None, self.db._resolve, url) + self.session_manager.resolve_cache[url] = await self.loop.run_in_executor(self.db._executor, self.db._resolve, url) return self.session_manager.resolve_cache[url] async def claimtrie_resolve(self, *urls) -> str: