Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastapi refactor #6558

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions backend/api/system/general.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import requests
import json

from backend.services.settings_service import SettingsService
from backend.services.messaging.smtp_service import SMTPService
from backend.models.postgis.release_version import ReleaseVersion
from fastapi import APIRouter, Depends, Request
Expand Down Expand Up @@ -183,7 +182,6 @@ async def get():
# return languages.model_dump(by_alias=True), 200



@router.get("/heartbeat/")
async def get(db: Database = Depends(get_db)):
"""
Expand All @@ -204,7 +202,7 @@ async def get(db: Database = Depends(get_db)):
LIMIT 1
"""
release = await db.fetch_one(query)

if release:
release_info = {
"version": release["tag_name"],
Expand All @@ -216,7 +214,6 @@ async def get(db: Database = Depends(get_db)):
return {"status": "Fastapi healthy", "release": release_info}, 200



# class SystemContactAdminRestAPI():
@router.post("/contact-admin/")
async def post(request: Request):
Expand Down
6 changes: 1 addition & 5 deletions backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ def assemble_db_connection(
username=params.get("username"),
password=params.get("password"),
host=params.get("host"),
port=str(params.get("port")),
port=int(params.get("port")),
path=f"{params.get('dbname')}",
)

return PostgresDsn.build(
scheme="postgresql+asyncpg",
username=info.data.get("POSTGRES_USER"),
Expand Down Expand Up @@ -269,9 +268,6 @@ def get_settings():
print(f"Loaded settings: {_settings.model_dump()}")
return _settings

# Ohsome Stats Token
OHSOME_STATS_TOKEN = os.getenv("OHSOME_STATS_TOKEN", None)


settings = get_settings()

Expand Down
Loading