From 726dff60bd864fb1a33383838089801e9e9ea087 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:31:50 +0900 Subject: [PATCH] =?UTF-8?q?[Update/bugfix]=20UI:=20Watchdog=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=9E=E3=83=BC=E3=81=AB10=E7=A7=92=E9=96=93?= =?UTF-8?q?=E9=9A=94=E3=81=A7=E4=BF=A1=E5=8F=B7=E3=82=92=E9=80=81=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=80=82=20backend=20watchdog?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=81=AE=E5=BC=95=E6=95=B0=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/webui_controller.py | 2 +- src-ui/app/App.jsx | 10 ++++++++++ src-ui/logics/useReceiveRoutes.js | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index 50c388a2..109f533b 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -1533,7 +1533,7 @@ class Controller: return {"status":200, "result":True} @staticmethod - def feedWatchdog() -> dict: + def feedWatchdog(*args, **kwargs) -> dict: model.feedWatchdog() return {"status":200, "result":True} diff --git a/src-ui/app/App.jsx b/src-ui/app/App.jsx index 80809c7d..08eccea8 100644 --- a/src-ui/app/App.jsx +++ b/src-ui/app/App.jsx @@ -68,6 +68,8 @@ const StartPythonFacadeComponent = () => { main_page.setDecorations(true); if (!hasRunRef.current) { asyncStartPython().then((result) => { + startFeedingToWatchDog(); + getUiLanguage(); getIsMainPageCompactMode(); @@ -133,4 +135,12 @@ const ConfigPageCloseTrigger = () => { } }, [currentIsOpenedConfigPage]); return null; +}; + +import { useStdoutToPython } from "@logics/useStdoutToPython"; +const startFeedingToWatchDog = () => { + const { asyncStdoutToPython } = useStdoutToPython(); + setInterval(() => { + asyncStdoutToPython("/run/feed_watchdog"); + }, 10000); // 10000ミリ秒 = 10秒 }; \ No newline at end of file diff --git a/src-ui/logics/useReceiveRoutes.js b/src-ui/logics/useReceiveRoutes.js index 45bb2cbd..3e5a6014 100644 --- a/src-ui/logics/useReceiveRoutes.js +++ b/src-ui/logics/useReceiveRoutes.js @@ -68,6 +68,7 @@ export const useReceiveRoutes = () => { } = useVolume(); const routes = { + "/run/feed_watchdog": () => {}, // Main Page // Page Controls "/get/data/main_window_sidebar_compact_mode": updateIsMainPageCompactMode,