debug: moved precache to background to avoid stucking ...
All checks were successful
Deploy on push / deploy (push) Successful in 45s

This commit is contained in:
Stepan Vladovskiy
2025-05-20 11:03:02 -03:00
parent 2bebfbd4df
commit 44aef147b5
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,6 @@ from cache.revalidator import revalidation_manager
from services.exception import ExceptionHandlerMiddleware
from services.redis import redis
from services.schema import create_all_tables, resolvers
#from services.search import search_service
from services.search import search_service, initialize_search_index
from services.viewed import ViewedStorage
from services.webhook import WebhookEndpoint, create_webhook_endpoint
@@ -53,9 +52,10 @@ async def lifespan(_app):
try:
print("[lifespan] Starting application initialization")
create_all_tables()
# schedule precaching in background to avoid blocking startup
asyncio.create_task(precache_data())
await asyncio.gather(
redis.connect(),
precache_data(),
ViewedStorage.init(),
create_webhook_endpoint(),
check_search_service(),