fix: keep dashboard terminal sessions alive
Deploy Dashboard (Dev) / deploy-dev (push) Successful in 2m5s

Remove backend idle timeout enforcement so terminal sessions persist until the UI disconnects or the SSH process ends.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Code
2026-03-03 05:48:14 +00:00
parent c29bda76f3
commit da88513456
+1 -10
View File
@@ -10,7 +10,6 @@ import config
logger = logging.getLogger(__name__)
MAX_SESSIONS = 5
IDLE_TIMEOUT = 30 * 60 # 30 minutes
_active_sessions: set = set()
HOSTS = {
@@ -95,18 +94,10 @@ async def ws_endpoint(websocket: WebSocket, host: str = Query("nas")):
pass
read_task = asyncio.create_task(read_ssh())
last_activity = time.monotonic()
try:
while True:
try:
msg = await asyncio.wait_for(websocket.receive(), timeout=60)
except asyncio.TimeoutError:
if time.monotonic() - last_activity > IDLE_TIMEOUT:
await websocket.close(code=1000, reason="Idle timeout")
break
continue
last_activity = time.monotonic()
msg = await websocket.receive()
if "bytes" in msg and msg["bytes"]:
data = msg["bytes"]
if data[0:1] == b"\x01" and len(data) == 5: