e1250 commited on
Commit
d51aaa4
·
1 Parent(s): d04c625

feat: saving dashboard background locally instead of memory

Browse files
api/routers/camera_stream.py CHANGED
@@ -99,7 +99,6 @@ async def websocket_detect(websocket: WebSocket, camera_id:str):
99
  # Note that JSONResponse doesn't work here, as it is for HTTP
100
  await websocket.send_json({"status": 200, "camera_id": camera_id})
101
 
102
-
103
  except WebSocketDisconnect:
104
  logger.warn(f"Client ID >>{camera_id}<< Disconnected Normally...")
105
  traceback.print_exc() # This one is actually really better, it shows more details about the issue happened.
@@ -114,7 +113,6 @@ async def websocket_detect(websocket: WebSocket, camera_id:str):
114
  active_cameras.dec()
115
 
116
 
117
-
118
  # Uncomment this when needed, It is the same but using HTTP, which is Request Response only. could be used for testing.
119
  # from fastapi import Request, UploadFile
120
  # @router.post("/detect")
 
99
  # Note that JSONResponse doesn't work here, as it is for HTTP
100
  await websocket.send_json({"status": 200, "camera_id": camera_id})
101
 
 
102
  except WebSocketDisconnect:
103
  logger.warn(f"Client ID >>{camera_id}<< Disconnected Normally...")
104
  traceback.print_exc() # This one is actually really better, it shows more details about the issue happened.
 
113
  active_cameras.dec()
114
 
115
 
 
116
  # Uncomment this when needed, It is the same but using HTTP, which is Request Response only. could be used for testing.
117
  # from fastapi import Request, UploadFile
118
  # @router.post("/detect")
api/routers/dashboard_stream.py CHANGED
@@ -1,7 +1,6 @@
1
  from fastapi import APIRouter, WebSocket, WebSocketDisconnect
2
- import asyncio
3
-
4
  from backend.api.routers.metrics import active_dashboards
 
5
 
6
  router = APIRouter()
7
 
 
1
  from fastapi import APIRouter, WebSocket, WebSocketDisconnect
 
 
2
  from backend.api.routers.metrics import active_dashboards
3
+ import asyncio
4
 
5
  router = APIRouter()
6