Skip to content

Commit

Permalink
healthcheck 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
stopmin committed Jul 18, 2024
1 parent 7a4b283 commit 9ea5efe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import asyncio
from typing import Optional

from dotenv import load_dotenv
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from starlette.exceptions import HTTPException

from app.config.exception_handler import exception_handler, http_exception_handler
Expand All @@ -14,7 +16,6 @@
from app.router.send_email_service_router import send_email_service_router
from app.router.user_type_router import user_type_router
from app.service.news_scheduling_service import schedule_task
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

Expand All @@ -29,10 +30,12 @@
allow_headers=["*"], # 모든 HTTP 헤더 허용
)


@app.on_event("startup")
async def startup_event():
asyncio.create_task(schedule_task())


# load env
load_dotenv()

Expand All @@ -50,6 +53,7 @@ async def startup_event():
app.add_exception_handler(Exception, exception_handler)
app.add_exception_handler(HTTPException, http_exception_handler)


@app.get("/health")
async def health_check():
async def health_check(q: Optional[str] = None): # pylint: disable=unused-argument
return {"status": "OK"}

0 comments on commit 9ea5efe

Please sign in to comment.