Skip to content

Commit

Permalink
report deletions on docs that doesnt exist, but dont raise
Browse files Browse the repository at this point in the history
  • Loading branch information
shyba committed Mar 8, 2021
1 parent 563a279 commit 08c3d6c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lbry/wallet/server/db/elastic_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ async def _consume_claim_producer(self, claim_producer):
async def claim_consumer(self, claim_producer):
await self.client.indices.refresh(self.index)
touched = set()
async for ok, item in async_streaming_bulk(self.client, self._consume_claim_producer(claim_producer)):
async for ok, item in async_streaming_bulk(self.client, self._consume_claim_producer(claim_producer),
raise_on_error=False):
if not ok:
self.logger.warning("indexing failed for an item: %s", item)
else:
Expand Down Expand Up @@ -283,8 +284,10 @@ async def resolve_stream(self, url: URL, channel_id: str = None):
claim_id = url.stream.claim_id
else:
claim_id = await self.full_id_from_short_id(query['name'], query['claim_id'], channel_id)
stream = await self.get_many(claim_id)
return stream[0] if len(stream) else None
if claim_id:
stream = await self.get_many(claim_id)
return stream[0] if len(stream) else None
return None

if channel_id is not None:
if set(query) == {'name'}:
Expand Down

0 comments on commit 08c3d6c

Please sign in to comment.