Fix database errors
All checks were successful
release-tag / release-image (push) Successful in 6m17s

This commit is contained in:
2024-07-03 11:57:01 +02:00
parent 7f72c94b9e
commit 6955739841
2 changed files with 3 additions and 3 deletions

View File

@@ -46,8 +46,7 @@ jobs:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
platforms: | platforms: |
linux/amd64 linux/amd64
linux/arm64
push: true push: true
tags: | # replace it with your local IP and tags tags: | # replace it with your local IP and tags
git.matsewe.de/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} git.matsewe.de/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}

View File

@@ -19,13 +19,14 @@ from starlette.middleware import Middleware
from starlette_context import context, plugins from starlette_context import context, plugins
from starlette_context.middleware import RawContextMiddleware from starlette_context.middleware import RawContextMiddleware
Base.metadata.create_all(engine)
if os.path.isfile("/tmp/first_run") and (os.environ.get("RELOAD_ON_FIRST_RUN", "").lower() == "true"): if os.path.isfile("/tmp/first_run") and (os.environ.get("RELOAD_ON_FIRST_RUN", "").lower() == "true"):
print("First run ... load data") print("First run ... load data")
with SessionLocal() as db: with SessionLocal() as db:
asyncio.run(admin.create_upload_file(include_non_singable=True, db=db)) asyncio.run(admin.create_upload_file(include_non_singable=True, db=db))
os.remove("/tmp/first_run") os.remove("/tmp/first_run")
# Base.metadata.create_all(engine)
middleware = [ middleware = [
Middleware( Middleware(