👍️[Update] Model : Watchdogタイマー機能を追加
"/run/feed_watchdog"でタイマーを定期的にリセットする必要あり
This commit is contained in:
@@ -28,6 +28,7 @@ from models.translation.translation_utils import checkCTranslate2Weight, downloa
|
||||
from models.transcription.transcription_whisper import checkWhisperWeight, downloadWhisperWeight
|
||||
from models.overlay.overlay import Overlay
|
||||
from models.overlay.overlay_image import OverlayImage
|
||||
from models.watchdog.watchdog import Watchdog
|
||||
|
||||
from config import config
|
||||
|
||||
@@ -101,6 +102,7 @@ class Model:
|
||||
self.mic_mute_status = None
|
||||
self.mic_mute_status_check = None
|
||||
self.kks = kakasi()
|
||||
self.watchdog = Watchdog(config.WATCHDOG_TIMEOUT, config.WATCHDOG_INTERVAL)
|
||||
|
||||
def checkCTranslatorCTranslate2ModelWeight(self):
|
||||
return checkCTranslate2Weight(config.PATH_LOCAL, config.CTRANSLATE2_WEIGHT_TYPE)
|
||||
@@ -780,4 +782,13 @@ class Model:
|
||||
def shutdownOverlay(self):
|
||||
self.overlay.shutdownOverlay()
|
||||
|
||||
def startWatchdog(self):
|
||||
self.watchdog.start()
|
||||
|
||||
def feedWatchdog(self):
|
||||
self.watchdog.feed()
|
||||
|
||||
def stopWatchdog(self):
|
||||
self.watchdog.stop()
|
||||
|
||||
model = Model()
|
||||
Reference in New Issue
Block a user