circular-fix
Some checks failed
Deploy on push / deploy (push) Failing after 17s

This commit is contained in:
2025-08-17 16:33:54 +03:00
parent bc8447a444
commit e78e12eeee
65 changed files with 3304 additions and 1051 deletions

View File

@@ -1,5 +1,5 @@
from math import ceil
from typing import Any, Optional
from typing import Any
from graphql import GraphQLResolveInfo
from sqlalchemy import desc, func, select, text
@@ -55,7 +55,7 @@ async def get_all_topics() -> list[Any]:
# Вспомогательная функция для получения тем со статистикой с пагинацией
async def get_topics_with_stats(
limit: int = 100, offset: int = 0, community_id: Optional[int] = None, by: Optional[str] = None
limit: int = 100, offset: int = 0, community_id: int | None = None, by: str | None = None
) -> dict[str, Any]:
"""
Получает темы со статистикой с пагинацией.
@@ -292,7 +292,7 @@ async def get_topics_with_stats(
# Функция для инвалидации кеша тем
async def invalidate_topics_cache(topic_id: Optional[int] = None) -> None:
async def invalidate_topics_cache(topic_id: int | None = None) -> None:
"""
Инвалидирует кеши тем при изменении данных.
@@ -350,7 +350,7 @@ async def get_topics_all(_: None, _info: GraphQLResolveInfo) -> list[Any]:
# Запрос на получение тем по сообществу
@query.field("get_topics_by_community")
async def get_topics_by_community(
_: None, _info: GraphQLResolveInfo, community_id: int, limit: int = 100, offset: int = 0, by: Optional[str] = None
_: None, _info: GraphQLResolveInfo, community_id: int, limit: int = 100, offset: int = 0, by: str | None = None
) -> list[Any]:
"""
Получает список тем, принадлежащих указанному сообществу с пагинацией и статистикой.
@@ -386,7 +386,7 @@ async def get_topics_by_author(
# Запрос на получение одной темы по её slug
@query.field("get_topic")
async def get_topic(_: None, _info: GraphQLResolveInfo, slug: str) -> Optional[Any]:
async def get_topic(_: None, _info: GraphQLResolveInfo, slug: str) -> Any | None:
topic = await get_cached_topic_by_slug(slug, get_with_stat)
if topic:
return topic