From e34b3c744563572801173dd6848c68a10c08f442 Mon Sep 17 00:00:00 2001 From: George Date: Wed, 23 Sep 2026 10:16:08 +0530 Subject: [PATCH] fix: --FIXED WEB SOCKET ISSUE --- .gitignore | 30 ++++++++++++++++++++++++++++++ main.py | 8 ++++---- 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9dde898 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Virtual environment +venv/ +.venv/ + +# Python cache +__pycache__/ +*.py[cod] + +# Environment variables / secrets +.env +.env.* + +# IDE / editor files +.vscode/ +.idea/ + +# OS files +.DS_Store + +# Logs +*.log + +# Python tooling caches +.pytest_cache/ +.mypy_cache/ + +# Build / packaging +build/ +dist/ +*.egg-info/ diff --git a/main.py b/main.py index 4fd20e2..690d86f 100644 --- a/main.py +++ b/main.py @@ -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 - ) \ No newline at end of file + )