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

7
cache/precache.py vendored
View File

@@ -3,11 +3,12 @@ import traceback
from sqlalchemy import and_, join, select
from auth.orm import Author, AuthorFollower
# Импорт Author, AuthorFollower отложен для избежания циклических импортов
from cache.cache import cache_author, cache_topic
from orm.shout import Shout, ShoutAuthor, ShoutReactionsFollower, ShoutTopic
from orm.topic import Topic, TopicFollower
from resolvers.stat import get_with_stat
from auth.orm import Author, AuthorFollower
from services.db import local_session
from services.redis import redis
from utils.encoders import fast_json_dumps
@@ -135,10 +136,10 @@ async def precache_data() -> None:
await redis.execute("SET", key, data)
elif isinstance(data, list) and data:
# List или ZSet
if any(isinstance(item, (list, tuple)) and len(item) == 2 for item in data):
if any(isinstance(item, list | tuple) and len(item) == 2 for item in data):
# ZSet with scores
for item in data:
if isinstance(item, (list, tuple)) and len(item) == 2:
if isinstance(item, list | tuple) and len(item) == 2:
await redis.execute("ZADD", key, item[1], item[0])
else:
# Regular list