reindex-fix
All checks were successful
Deploy on push / deploy (push) Successful in 23s

This commit is contained in:
Untone 2024-04-08 10:23:54 +03:00
parent aa1693cc16
commit df15e63dde

View File

@ -131,9 +131,11 @@ class SearchService:
if self.client:
id_ = str(shout.id)
logger.debug(f' Индексируем пост {id_}')
asyncio.create_task(
self.client.index(index=self.index_name, id=id_, body=shout.dict())
)
asyncio.create_task(self.perform_index(shout))
async def perform_index(self, shout):
if self.client:
await self.client.index(index=self.index_name, id=str(shout.id), body=shout.dict())
async def search(self, text, limit, offset):
logger.debug(f' Ищем: {text}')