add handling for public streams
new env vars for mediamtx switch to redis for ipc
This commit is contained in:
parent
215ffced7c
commit
6233c96e6a
5 changed files with 120 additions and 31 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import asyncio
|
||||
import datetime
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
|
@ -11,6 +12,7 @@ from .util import minioClient, ergo
|
|||
from fastapi_utils.tasks import repeat_every
|
||||
from sqlalchemy import and_
|
||||
from contextlib import asynccontextmanager
|
||||
from .endpoints.mediamtx import mediamtxPoll
|
||||
|
||||
|
||||
@repeat_every(seconds=60 * 60)
|
||||
|
|
@ -37,6 +39,9 @@ async def cleanup():
|
|||
@asynccontextmanager
|
||||
async def onStart(app: FastAPI):
|
||||
await cleanup()
|
||||
await util.ergo.init()
|
||||
asyncio.get_running_loop().create_task(mediamtxPoll())
|
||||
print("Initialized")
|
||||
yield
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue