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 + )