From 063286e899acce2d55c308ad749788c68861d932 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Thu, 28 Oct 2021 16:22:24 +0300 Subject: [PATCH] UI: fix long telemetry log loading bug --- .../monkey_island/cc/ui/src/components/map/TelemetryLog.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/ui/src/components/map/TelemetryLog.tsx b/monkey/monkey_island/cc/ui/src/components/map/TelemetryLog.tsx index dfbcad8ff..45e303a9c 100644 --- a/monkey/monkey_island/cc/ui/src/components/map/TelemetryLog.tsx +++ b/monkey/monkey_island/cc/ui/src/components/map/TelemetryLog.tsx @@ -4,6 +4,7 @@ import LoadingIcon from '../ui-components/LoadingIcon'; const authComponent = new AuthComponent({}); +const telemetryUpdatePeriod = 5000; // UI will fetch telemetries every N milliseconds. const TelemetryLog = (props: { onStatusChange: Function }) => { @@ -19,7 +20,8 @@ const TelemetryLog = (props: { onStatusChange: Function }) => { const telemetryConsole = useRef(null); useEffect(() => { - const interval = setInterval(updateTelemetryFromServer, 5000); + updateTelemetryFromServer(); + const interval = setInterval(updateTelemetryFromServer, telemetryUpdatePeriod); return function cleanup() { clearInterval(interval); };