Started (incomplete) implementation of stream verification scheduler and endpoints
All checks were successful
AWS Deploy on Push / build (push) Successful in 5m18s
All checks were successful
AWS Deploy on Push / build (push) Successful in 5m18s
This commit is contained in:
13
app/main.py
13
app/main.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user