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,