Files
web-inspector/backend/app/core/config.py
jungwoo choi 3d03c47aaa fix: 진행 페이지 리로드 시 무한 로딩 + 동시 검사 수 상한 수정
- 리로드 시 API에서 현재 상태를 조회하여 스토어 복원 (initFromApi)
- SITE_CONCURRENCY 서버 상한 4→8로 변경 (사용자 설정 8이 제대로 동작)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:50:14 +09:00

40 lines
856 B
Python

"""
Application configuration from environment variables.
"""
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""Application settings loaded from environment variables."""
# MongoDB
MONGODB_URL: str = "mongodb://admin:password123@localhost:27022/"
DB_NAME: str = "web_inspector"
# Redis
REDIS_URL: str = "redis://localhost:6392"
# Inspection
URL_FETCH_TIMEOUT: int = 10
CATEGORY_TIMEOUT: int = 60
MAX_HTML_SIZE: int = 10485760 # 10MB
# Site inspection
SITE_MAX_PAGES: int = 500
SITE_MAX_DEPTH: int = 2
SITE_CONCURRENCY: int = 8
# Application
PROJECT_NAME: str = "Web Inspector API"
class Config:
env_file = ".env"
case_sensitive = True
@lru_cache()
def get_settings() -> Settings:
return Settings()