feat: backend orkestrasyonunu ve arac entegrasyonlarini genislet
This commit is contained in:
@@ -3,6 +3,7 @@ from contextlib import asynccontextmanager
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from app.automation.scheduler import AutomationScheduler
|
||||
from app.admin.routes import router as admin_router
|
||||
from app.config import get_settings
|
||||
from app.db import init_db, session_scope
|
||||
@@ -21,6 +22,8 @@ async def lifespan(_: FastAPI):
|
||||
if settings.telegram_bot_token:
|
||||
runtime_services.telegram_bot = TelegramBotService(settings.telegram_bot_token, session_scope)
|
||||
await runtime_services.telegram_bot.start()
|
||||
runtime_services.automation_scheduler = AutomationScheduler(session_scope, runtime_services.telegram_bot)
|
||||
await runtime_services.automation_scheduler.start()
|
||||
yield
|
||||
await runtime_services.shutdown()
|
||||
|
||||
@@ -30,6 +33,7 @@ app = FastAPI(title="WiseClaw", version="0.1.0", lifespan=lifespan)
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["http://127.0.0.1:5173", "http://localhost:5173"],
|
||||
allow_origin_regex=r"^https?://(localhost|127\.0\.0\.1|192\.168\.\d{1,3}\.\d{1,3})(:\d+)?$",
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
|
||||
Reference in New Issue
Block a user