Started (incomplete) implementation of stream verification scheduler and endpoints
All checks were successful
AWS Deploy on Push / build (push) Successful in 5m18s

This commit is contained in:
2025-06-17 17:12:39 -05:00
parent abb467749b
commit a42d4c30a6
14 changed files with 1066 additions and 33 deletions

View File

@@ -2,7 +2,8 @@ from fastapi import FastAPI
from fastapi.concurrency import asynccontextmanager
from fastapi.openapi.utils import get_openapi
from app.routers import auth, channels, groups, playlist, priorities
from app.iptv.scheduler import StreamScheduler
from app.routers import auth, channels, groups, playlist, priorities, scheduler
from app.utils.database import init_db
@@ -10,8 +11,17 @@ from app.utils.database import init_db
async def lifespan(app: FastAPI):
# Initialize database tables on startup
init_db()
# Initialize and start the stream scheduler
scheduler = StreamScheduler(app)
app.state.scheduler = scheduler # Store scheduler in app state
scheduler.start()
yield
# Shutdown scheduler on app shutdown
scheduler.shutdown()
app = FastAPI(
lifespan=lifespan,
@@ -69,3 +79,4 @@ app.include_router(channels.router)
app.include_router(playlist.router)
app.include_router(priorities.router)
app.include_router(groups.router)
app.include_router(scheduler.router)