From 09b7d59b39b31af5e2d923643f8a81fdbb4fdc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Mon, 5 Sep 2022 12:56:57 +0000 Subject: [PATCH] use production mode switch for reloading --- api/.vscode/launch.json | 5 ++++- api/ovdashboard_api/main.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index 8a57e6e..a8d8888 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -9,7 +9,10 @@ "type": "python", "request": "launch", "module": "ovdashboard_api.main", - "justMyCode": true + "justMyCode": true, + "env": { + "PRODUCTION_MODE": "false" + } } ] } \ No newline at end of file diff --git a/api/ovdashboard_api/main.py b/api/ovdashboard_api/main.py index c133181..5dcbb92 100644 --- a/api/ovdashboard_api/main.py +++ b/api/ovdashboard_api/main.py @@ -9,8 +9,8 @@ Creates the main `FastAPI` app. import uvicorn from fastapi import FastAPI -from .settings import SETTINGS from .routers import main_router +from .settings import SETTINGS app = FastAPI( title="OVDashboard API", @@ -36,7 +36,7 @@ def main() -> None: app="ovdashboard_api.main:app", host="0.0.0.0", port=8000, - reload=True, + reload=not SETTINGS.production_mode, )