refactor: 不要なシャットダウン処理を削除し、アプリ終了時のテレメトリ送信を簡素化
This commit is contained in:
@@ -1297,63 +1297,12 @@ class Model:
|
|||||||
errorLogging()
|
errorLogging()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# =========================================================================
|
|
||||||
# Telemetry Methods (MVC Pattern)
|
|
||||||
# =========================================================================
|
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
"""Model cleanup on application shutdown."""
|
"""Model cleanup on application shutdown."""
|
||||||
# Telemetry 終了(app_closed 送信)
|
# Telemetry 終了(app_closed 送信)
|
||||||
if hasattr(self, "telemetry") and self.telemetry:
|
if hasattr(self, "telemetry") and self.telemetry:
|
||||||
self.telemetry.shutdown()
|
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):
|
def telemetryTrack(self, event: str, payload: dict = None):
|
||||||
"""汎用テレメトリイベント送信 (Model ラッパー)"""
|
"""汎用テレメトリイベント送信 (Model ラッパー)"""
|
||||||
if hasattr(self, "telemetry") and self.telemetry:
|
if hasattr(self, "telemetry") and self.telemetry:
|
||||||
|
|||||||
@@ -154,16 +154,8 @@ export const useWindow = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const asyncCloseApp = async () => {
|
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");
|
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));
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
|
||||||
// Now close the UI window (this will also terminate the backend sidecar)
|
|
||||||
await appWindow.close();
|
await appWindow.close();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user