Revert "services"

This reverts commit c20bd6a067.
This commit is contained in:
unknown
2025-12-13 08:12:48 +09:00
parent c20bd6a067
commit 7153927518
6 changed files with 59 additions and 260 deletions

View File

@@ -3,8 +3,7 @@ from fastapi.middleware.cors import CORSMiddleware
from contextlib import asynccontextmanager
from app.config import settings
from app.database import engine, Base
from app.api import auth, vms, tunnel, admin, ssh_credentials, ws
import asyncio
from app.api import auth, vms, tunnel, admin, ssh_credentials
import logging
# 로깅 설정
@@ -48,18 +47,9 @@ async def lifespan(app: FastAPI):
finally:
db.close()
# 백그라운드 모니터링 시작
monitor_task = asyncio.create_task(ws.start_monitoring_task())
yield
# 종료 시
monitor_task.cancel()
try:
await monitor_task
except asyncio.CancelledError:
pass
logger.info("🛑 VConnect API 서버 종료")
# FastAPI 앱 생성
@@ -85,7 +75,6 @@ app.include_router(vms.router, prefix=f"{settings.API_V1_PREFIX}/vms", tags=["VM
app.include_router(tunnel.router, prefix=f"{settings.API_V1_PREFIX}/tunnel", tags=["터널 관리"])
app.include_router(admin.router, prefix=f"{settings.API_V1_PREFIX}/admin", tags=["관리자"])
app.include_router(ssh_credentials.router, prefix=f"{settings.API_V1_PREFIX}/ssh", tags=["SSH 자격증명"])
app.include_router(ws.router, prefix="/ws", tags=["WebSocket"])
# Health Check
@app.get("/health")