- 기본값 2→4로 변경, 사용자가 [1, 2, 4, 8] 중 선택 가능 - 백엔드: concurrency 파라미터 추가 (API → 서비스 → Semaphore) - 프론트: 드롭다운에 "동시 검사 수" 옵션 UI 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
40 lines
856 B
Python
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 = 4
|
|
|
|
# Application
|
|
PROJECT_NAME: str = "Web Inspector API"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
return Settings()
|