Epic 3: Economy & Billing Engine (Pénzügyi Motor)
This commit is contained in:
@@ -8,10 +8,11 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from starlette.middleware.sessions import SessionMiddleware
|
||||
|
||||
from app.api.v1.api import api_router
|
||||
from app.api.v1.api import api_router
|
||||
from app.core.config import settings
|
||||
from app.database import AsyncSessionLocal
|
||||
from app.services.translation_service import translation_service
|
||||
from app.core.scheduler import scheduler_lifespan
|
||||
|
||||
# --- LOGGING KONFIGURÁCIÓ ---
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
@@ -20,8 +21,8 @@ logger = logging.getLogger("Sentinel-Main")
|
||||
# --- LIFESPAN (Startup/Shutdown események) ---
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
"""
|
||||
A rendszer 'ébredési' folyamata.
|
||||
"""
|
||||
A rendszer 'ébredési' folyamata.
|
||||
Hiba esetén ENG alapértelmezésre vált a rendszer.
|
||||
"""
|
||||
logger.info("🛰️ Sentinel Master System ébredése...")
|
||||
@@ -39,9 +40,13 @@ async def lifespan(app: FastAPI):
|
||||
os.makedirs(settings.STATIC_DIR, exist_ok=True)
|
||||
os.makedirs(os.path.join(settings.STATIC_DIR, "previews"), exist_ok=True)
|
||||
|
||||
yield
|
||||
|
||||
logger.info("💤 Sentinel Master System leállítása...")
|
||||
# 2. Scheduler indítása
|
||||
async with scheduler_lifespan(app):
|
||||
logger.info("⏰ Cron‑job ütemező aktiválva.")
|
||||
|
||||
yield
|
||||
|
||||
logger.info("💤 Sentinel Master System leállítása...")
|
||||
|
||||
# --- APP INICIALIZÁLÁS ---
|
||||
app = FastAPI(
|
||||
|
||||
Reference in New Issue
Block a user