From de9e8143050f80b24edea35fccd88a7cfa36a8b1 Mon Sep 17 00:00:00 2001 From: nguyentrungthat <80239428+nguentrungthat@users.noreply.github.com> Date: Sat, 22 Nov 2025 10:11:44 +0700 Subject: [PATCH] Adjust connection and UI timeout durations Reduced sleep delay in socket reconnection logic and increased disable timeout in ModalTerminal from 5s to 10s. These changes aim to improve responsiveness and user experience during connection and UI interactions. --- BACKEND/providers/socket_io_provider.ts | 4 ++-- FRONTEND/src/components/ModalTerminal.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BACKEND/providers/socket_io_provider.ts b/BACKEND/providers/socket_io_provider.ts index a6d2328..e8965b3 100644 --- a/BACKEND/providers/socket_io_provider.ts +++ b/BACKEND/providers/socket_io_provider.ts @@ -565,7 +565,7 @@ export class WebSocketIo { if (line && line.config.status === 'connected') { this.lineConnecting = this.lineConnecting.filter((el) => el !== lineId) this.setTimeoutConnect(lineId, line, options.timeout) - await sleep(500) + // await sleep(500) await action(line, options) } else { if (this.lineConnecting.includes(lineId)) continue @@ -587,7 +587,7 @@ export class WebSocketIo { const lineReconnect = this.lineMap.get(lineId) if (lineReconnect) { this.setTimeoutConnect(lineId, lineReconnect, options.timeout) - await sleep(500) + await sleep(100) await action(lineReconnect, options) } } else { diff --git a/FRONTEND/src/components/ModalTerminal.tsx b/FRONTEND/src/components/ModalTerminal.tsx index 05d6143..0aa9e68 100644 --- a/FRONTEND/src/components/ModalTerminal.tsx +++ b/FRONTEND/src/components/ModalTerminal.tsx @@ -342,7 +342,7 @@ const ModalTerminal = ({ setIsDisable(true); setTimeout(() => { setIsDisable(false); - }, 5000); + }, 10000); }; const findSwitchPort = (portName: string): SwitchPortsProps | null => {