fix: close connection after GET in websocket
This commit is contained in:
@@ -48,7 +48,9 @@ async def websocket_endpoint(websocket: WebSocket, user_id: int):
|
||||
try:
|
||||
# send already available data
|
||||
r = processed_agent_data.select().order_by(processed_agent_data.c.timestamp)
|
||||
session = SessionLocal()
|
||||
stored_data = SessionLocal().execute(r).fetchall()
|
||||
session.close()
|
||||
|
||||
jsonable_data = [{c.name: getattr(i, c.name) for c in processed_agent_data.columns} for i in stored_data]
|
||||
for i in jsonable_data:
|
||||
|
||||
Reference in New Issue
Block a user