nosearchinfo
All checks were successful
Deploy to core / deploy (push) Successful in 4m8s

This commit is contained in:
Untone 2024-02-23 13:40:40 +03:00
parent 72aa21c9cd
commit 595e4ba87d
2 changed files with 7 additions and 8 deletions

View File

@ -9,7 +9,6 @@ from starlette.routing import Route
from services.rediscache import redis from services.rediscache import redis
from services.schema import resolvers from services.schema import resolvers
from services.search import search_service
from services.viewed import ViewedStorage from services.viewed import ViewedStorage
from services.webhook import WebhookEndpoint from services.webhook import WebhookEndpoint
from settings import DEV_SERVER_PID_FILE_NAME, MODE from settings import DEV_SERVER_PID_FILE_NAME, MODE
@ -36,7 +35,7 @@ app = Starlette(
on_startup=[ on_startup=[
redis.connect, redis.connect,
ViewedStorage.init, ViewedStorage.init,
search_service.info, # search_service.info,
# start_sentry, # start_sentry,
start, start,
], ],

View File

@ -12,12 +12,12 @@ def add_topic_stat_columns(q):
aliased_topic_followers = aliased(TopicFollower) aliased_topic_followers = aliased(TopicFollower)
aliased_topic = aliased(Topic) aliased_topic = aliased(Topic)
q = ( q = (
q.outerjoin(ShoutTopic, aliased_topic.id == ShoutTopic.topic) q.outerjoin(ShoutTopic, aliased_topic.id == ShoutTopic.c.topic)
.add_columns(func.count(distinct(ShoutTopic.shout)).label('shouts_stat')) .add_columns(func.count(distinct(ShoutTopic.c.shout)).label('shouts_stat'))
.outerjoin(aliased_shout_authors, ShoutTopic.shout == aliased_shout_authors.shout) .outerjoin(aliased_shout_authors, ShoutTopic.c.shout == aliased_shout_authors.c.shout)
.add_columns(func.count(distinct(aliased_shout_authors.author)).label('authors_stat')) .add_columns(func.count(distinct(aliased_shout_authors.c.author)).label('authors_stat'))
.outerjoin(aliased_topic_followers, aliased_topic.id == aliased_topic_followers.topic) .outerjoin(aliased_topic_followers, aliased_topic.c.id == aliased_topic_followers.c.topic)
.add_columns(func.count(distinct(aliased_topic_followers.follower)).label('followers_stat')) .add_columns(func.count(distinct(aliased_topic_followers.c.follower)).label('followers_stat'))
) )
q = q.group_by(aliased_topic.id) q = q.group_by(aliased_topic.id)