diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index f65ae48a..04bc35d9 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -35,7 +35,7 @@ jobs: ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} - name: Push to dokku for staging branch - if: github.ref == 'refs/heads/staging' + if: github.ref == 'refs/heads/feat/sv-search-v4' uses: dokku/github-action@master with: branch: 'dev' diff --git a/main.py b/main.py index 536dfdc2..6e6034e2 100644 --- a/main.py +++ b/main.py @@ -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(),