49 lines
1.4 KiB
Python
49 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Main entry point for the FastAPI server
|
|
"""
|
|
import uvicorn
|
|
from src.config.settings import settings
|
|
from src.config.logging_config import setup_logging, get_logger
|
|
|
|
# Setup logging
|
|
setup_logging()
|
|
logger = get_logger(__name__)
|
|
|
|
if __name__ == "__main__":
|
|
logger.info(f"Starting {settings.APP_NAME} on {settings.HOST}:{settings.PORT}")
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
# Only watch the src directory to avoid watching logs, uploads, etc.
|
|
base_dir = Path(__file__).parent
|
|
src_dir = str(base_dir / "src")
|
|
|
|
# Temporarily disable reload to stop constant "1 change detected" messages
|
|
# The file watcher is detecting changes that cause a loop
|
|
# TODO: Investigate what's causing constant file changes
|
|
use_reload = False # Disabled until we identify the source of constant changes
|
|
|
|
uvicorn.run(
|
|
"src.main:app",
|
|
host=settings.HOST,
|
|
port=8000,
|
|
reload=use_reload,
|
|
log_level=settings.LOG_LEVEL.lower(),
|
|
reload_dirs=[src_dir] if use_reload else None,
|
|
reload_excludes=[
|
|
"*.log",
|
|
"*.pyc",
|
|
"*.pyo",
|
|
"*.pyd",
|
|
"__pycache__",
|
|
"**/__pycache__/**",
|
|
"*.db",
|
|
"*.sqlite",
|
|
"*.sqlite3"
|
|
],
|
|
reload_delay=1.0 # Increase delay to reduce false positives
|
|
)
|
|
|