Skip to content

Commit

Permalink
Add minor fix for locally run instances where the database was not ge…
Browse files Browse the repository at this point in the history
…tting initialized in some cases
  • Loading branch information
Jekannadar committed Sep 9, 2024
1 parent 5a8ec78 commit 2a346b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion applications/cls-cad-backend/cls_cad_backend/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
get_taxonomy_for_project,
upsert_part,
upsert_result,
upsert_taxonomy,
upsert_taxonomy, init_database,
)
from cls_cad_backend.repository_builder import RepositoryBuilder, wrapped_counted_types
from cls_cad_backend.responses import FastResponse
Expand All @@ -37,6 +37,8 @@
from starlette.background import BackgroundTasks
from starlette.staticfiles import StaticFiles

init_database()

origins = [
"http://localhost:3000",
"http://localhost:8000",
Expand Down
2 changes: 0 additions & 2 deletions applications/cls-cad-backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@

def start():
"""Launched with `poetry run start` at root level."""
init_database()
uvicorn.run("cls_cad_backend.server:app", reload=True)


def start_docker():
"""Launched with `poetry run start` at root level."""
init_database()
uvicorn.run("cls_cad_backend.server:app", reload=False, host="0.0.0.0", port=80)


Expand Down

0 comments on commit 2a346b6

Please sign in to comment.