This commit is contained in:
parent
8b65c87750
commit
5966512a8f
|
@ -22,11 +22,12 @@ opensearch-py = "^2.6.0"
|
|||
httpx = "^0.27.0"
|
||||
dogpile-cache = "^1.3.1"
|
||||
colorlog = "^6.8.2"
|
||||
fakeredis = "^2.25.1"
|
||||
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
ruff = "^0.4.7"
|
||||
isort = "^5.13.2"
|
||||
fakeredis = "^2.25.1"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
|
|
|
@ -329,12 +329,11 @@ async def update_reaction(_, info, reaction):
|
|||
try:
|
||||
reaction_query = query_reactions().filter(Reaction.id == rid)
|
||||
reaction_query = add_reaction_stat_columns(reaction_query)
|
||||
reaction_query = reaction_query.group_by(Reaction.id)
|
||||
reaction_query = reaction_query.group_by(Reaction.id, Author.id, Shout.id)
|
||||
|
||||
result = session.execute(reaction_query).unique().first()
|
||||
if result:
|
||||
r, commented_stat, rating_stat = result
|
||||
author = session.query(Author).filter(Author.user == user_id).first()
|
||||
r, author, shout, commented_stat, rating_stat = result
|
||||
if not r or not author:
|
||||
return {"error": "Invalid reaction ID or unauthorized"}
|
||||
|
||||
|
|
|
@ -141,9 +141,10 @@ class SearchService:
|
|||
if isinstance(result, dict):
|
||||
mapping = result.get(self.index_name, {}).get("mappings")
|
||||
logger.info(f"Найдена структура индексации: {mapping['properties'].keys()}")
|
||||
if mapping and mapping["properties"].keys() != expected_mapping["properties"].keys():
|
||||
expected_keys = expected_mapping["properties"].keys()
|
||||
if mapping and mapping["properties"].keys() != expected_keys:
|
||||
logger.info(f"Ожидаемая структура индексации: {expected_mapping}")
|
||||
logger.warn("[!!!] Требуется переиндексация всех данных")
|
||||
logger.warning("[!!!] Требуется переиндексация всех данных")
|
||||
self.delete_index()
|
||||
self.client = None
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user