precached-authors-fix
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
2023-12-19 11:25:06 +03:00
parent b2040099a8
commit c3a6ecd3ae
4 changed files with 43 additions and 48 deletions

View File

@@ -9,6 +9,7 @@ from sentry_sdk.integrations.ariadne import AriadneIntegration
from sentry_sdk.integrations.redis import RedisIntegration
from starlette.applications import Starlette
from services.core import get_all_authors
from services.rediscache import redis
from services.schema import resolvers
from settings import DEV_SERVER_PID_FILE_NAME, MODE, SENTRY_DSN
@@ -27,6 +28,11 @@ async def start_up():
f.write(str(os.getpid()))
else:
await redis.connect()
# load authors cache
authors = await get_all_authors()
print(f"[main] {len(authors)} authors precached")
# startup sentry monitoring services
try:
import sentry_sdk