From 19af0ea918c1c303432851579c111bd4071cabc0 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Fri, 9 Jan 2026 22:30:01 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E3=82=B7=E3=83=A3=E3=83=83=E3=83=88=E3=83=80=E3=82=A6=E3=83=B3?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=80=81?= =?UTF-8?q?=E3=82=A2=E3=83=97=E3=83=AA=E7=B5=82=E4=BA=86=E6=99=82=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=83=AC=E3=83=A1=E3=83=88=E3=83=AA=E9=80=81=E4=BF=A1?= =?UTF-8?q?=E3=82=92=E7=B0=A1=E7=B4=A0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/model.py | 59 +++---------------------------- src-ui/logics/common/useWindow.js | 8 ----- 2 files changed, 4 insertions(+), 63 deletions(-) diff --git a/src-python/model.py b/src-python/model.py index 755aca39..51ddf876 100644 --- a/src-python/model.py +++ b/src-python/model.py @@ -1296,74 +1296,23 @@ class Model: except Exception: errorLogging() return False - - # ========================================================================= - # Telemetry Methods (MVC Pattern) - # ========================================================================= - + def shutdown(self): """Model cleanup on application shutdown.""" # Telemetry 終了(app_closed 送信) if hasattr(self, "telemetry") and self.telemetry: self.telemetry.shutdown() - - try: - # オーバーレイ終了 - if hasattr(self, 'overlay') and self.overlay: - self.shutdownOverlay() - except Exception: - errorLogging() - - try: - # Watchdog 停止 - if hasattr(self, 'th_watchdog'): - self.stopWatchdog() - except Exception: - errorLogging() - - try: - # WebSocket サーバー停止 - if hasattr(self, 'websocket_server_alive') and self.websocket_server_alive: - self.stopWebSocketServer() - except Exception: - errorLogging() - - try: - # OSC ハンドラー停止 - if hasattr(self, 'osc_handler'): - self.stopReceiveOSC() - except Exception: - errorLogging() - - try: - # オーディオ停止 - self.stopMicTranscript() - self.stopSpeakerTranscript() - self.stopCheckMicEnergy() - self.stopCheckSpeakerEnergy() - except Exception: - errorLogging() - - try: - # ロガー停止 - if hasattr(self, 'logger') and self.logger: - self.stopLogger() - except Exception: - errorLogging() - - # メモリ解放 - gc.collect() - + def telemetryTrack(self, event: str, payload: dict = None): """汎用テレメトリイベント送信 (Model ラッパー)""" if hasattr(self, "telemetry") and self.telemetry: self.telemetry.track(event, payload) - + def telemetryTrackCoreFeature(self, feature: str): """コア機能テレメトリイベント送信 (Model ラッパー)""" if hasattr(self, "telemetry") and self.telemetry: self.telemetry.track_core_feature(feature) - + def telemetryTouchActivity(self): """テレメトリアクティビティ更新 (Model ラッパー)""" if hasattr(self, "telemetry") and self.telemetry: diff --git a/src-ui/logics/common/useWindow.js b/src-ui/logics/common/useWindow.js index b027cd9f..d87b14f1 100644 --- a/src-ui/logics/common/useWindow.js +++ b/src-ui/logics/common/useWindow.js @@ -154,16 +154,8 @@ export const useWindow = () => { }; const asyncCloseApp = async () => { - // Send shutdown signal to backend before closing the app - // This ensures telemetry app_closed event is sent and flushed - // Note: Don't await this call, let it run in background (fire-and-forget) asyncStdoutToPython("/run/shutdown"); - - // Give backend time to process shutdown and flush telemetry - // Tauri sidecar will be terminated when UI closes, so timing is critical await new Promise(resolve => setTimeout(resolve, 2000)); - - // Now close the UI window (this will also terminate the backend sidecar) await appWindow.close(); };