From 6d345ddddcd5ef399ffec6cc72a601fa1d088ae4 Mon Sep 17 00:00:00 2001 From: optrader Date: Tue, 25 Nov 2025 23:01:53 +0900 Subject: [PATCH] [251125] fix: Memory Monitoring - 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 11. 25. 23:01:53 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 1๊ฐœ โ€ข ์ถ”๊ฐ€: +8์ค„ โ€ข ์‚ญ์ œ: -10์ค„ ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx ๐Ÿ”ง ์ฃผ์š” ๋ณ€๊ฒฝ ๋‚ด์šฉ: โ€ข ์ฝ”๋“œ ์ •๋ฆฌ ๋ฐ ์ตœ์ ํ™” Performance: ์ฝ”๋“œ ์ตœ์ ํ™”๋กœ ์„ฑ๋Šฅ ๊ฐœ์„  ๊ธฐ๋Œ€ --- .../src/views/PlayerPanel/PlayerPanel.jsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index 83d70067..e969152f 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -381,24 +381,22 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props }, []); // ์žฌ์ƒ ์ค‘ 15์ดˆ๋งˆ๋‹ค ๋ฉ”๋ชจ๋ฆฌ ๋ชจ๋‹ˆํ„ฐ๋ง - const lastMemoryLogTimeRef = useRef(0); useEffect(() => { - const mediaState = videoPlayer.current?.getMediaState(); + const memoryLogInterval = setInterval(() => { + const mediaState = videoPlayer.current?.getMediaState(); - // ์žฌ์ƒ ์ค‘์ธ์ง€ ํ™•์ธ (duration > 0์ด๊ณ  paused๊ฐ€ ์•„๋‹˜) - if (mediaState?.duration > 0 && !mediaState?.paused && currentTime > 0) { - const now = Date.now(); - // ๋งˆ์ง€๋ง‰ ๋กœ๊ทธ ์ดํ›„ 15์ดˆ ์ด์ƒ ๊ฒฝ๊ณผํ–ˆ์œผ๋ฉด ๋กœ๊น… - if (now - lastMemoryLogTimeRef.current >= 15000) { + // ์žฌ์ƒ ์ค‘์ธ์ง€ ํ™•์ธ (duration > 0์ด๊ณ  paused๊ฐ€ ์•„๋‹˜) + if (mediaState?.duration > 0 && !mediaState?.paused && mediaState?.currentTime > 0) { memoryMonitor.current.logMemory('[Video Playing]', { currentTime: (mediaState?.currentTime ?? 0).toFixed(2), duration: (mediaState?.duration ?? 0).toFixed(2), buffered: (mediaState?.proportionLoaded ?? 0).toFixed(2), }); - lastMemoryLogTimeRef.current = now; } - } - }, [currentTime]); + }, 15000); // 15์ดˆ๋งˆ๋‹ค ์ฒดํฌ + + return () => clearInterval(memoryLogInterval); + }, []); // PlayerPanel.jsx์˜ ๋ผ์ธ 313-327 useEffect ์ˆ˜์ • - detailPanelClosed flag ๊ฐ์ง€ ์ถ”๊ฐ€ useEffect(() => {