fix:
--FIXED WEB SOCKET ISSUE
This commit is contained in:
1 parent
1c7e7cc886
commit
e34b3c7445
2 files changed
+34
-4
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import psutil
|
||||
from fastapi import FastAPI
|
||||
|
||||
import asyncio
|
||||
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ async def hardware_status_monitor(websocket: WebSocket):
|
||||
|
||||
result = await asyncio.wait_for(
|
||||
asyncio.to_thread(
|
||||
get_hardware_status
|
||||
hardware_status
|
||||
),
|
||||
timeout=3
|
||||
)
|
||||
@@ -92,4 +92,4 @@ if __name__ == "__main__":
|
||||
app,
|
||||
host="0.0.0.0",
|
||||
port=9100
|
||||
)
|
||||
)
|
||||
Reference in new issue
Block a user