modify: sophon 视频文件上传、告警接口
This commit is contained in:
@@ -21,11 +21,13 @@ async def get_offline_devices(worker_id: str = "") -> dict:
|
||||
|
||||
offline_devices = []
|
||||
try:
|
||||
if db is None:
|
||||
raise RuntimeError("Database not initialized")
|
||||
async with db.get_session() as session:
|
||||
from ..models.orm import BoardHeartbeat
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy import desc, select
|
||||
|
||||
stmt = select(BoardHeartbeat).order_by(BoardHeartbeat.last_ping_time.desc())
|
||||
stmt = select(BoardHeartbeat).order_by(desc(BoardHeartbeat.last_ping_time)) # type: ignore
|
||||
result = await session.execute(stmt)
|
||||
records = result.scalars().all()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user