forked from LBRYCommunity/lbry-sdk
executors
This commit is contained in:
parent
dac1b82ea7
commit
b83360f3e2
2 changed files with 3 additions and 3 deletions
|
@ -62,7 +62,7 @@ class MemPool:
|
||||||
|
|
||||||
def refresh(self) -> typing.Set[bytes]: # returns list of new touched hashXs
|
def refresh(self) -> typing.Set[bytes]: # returns list of new touched hashXs
|
||||||
prefix_db = self._db.prefix_db
|
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.clear()
|
||||||
self.raw_mempool.update(new_mempool)
|
self.raw_mempool.update(new_mempool)
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ class MemPool:
|
||||||
self.session_manager.mempool_statuses.pop(hashX, None)
|
self.session_manager.mempool_statuses.pop(hashX, None)
|
||||||
# self.bp._chain_executor
|
# self.bp._chain_executor
|
||||||
await asyncio.get_event_loop().run_in_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):
|
if touched or new_touched or (height_changed and self.session_manager.mempool_statuses):
|
||||||
|
|
|
@ -984,7 +984,7 @@ class LBRYElectrumX(SessionBase):
|
||||||
|
|
||||||
async def _cached_resolve_url(self, url):
|
async def _cached_resolve_url(self, url):
|
||||||
if url not in self.session_manager.resolve_cache:
|
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]
|
return self.session_manager.resolve_cache[url]
|
||||||
|
|
||||||
async def claimtrie_resolve(self, *urls) -> str:
|
async def claimtrie_resolve(self, *urls) -> str:
|
||||||
|
|
Loading…
Reference in a new issue