watchdog thread

This commit is contained in:
dries.k
2022-01-29 17:40:15 +01:00
parent 28a8912528
commit 2236a9687d
4 changed files with 32 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ from gotify_tray.tasks import (
GetApplicationMessagesTask,
GetApplicationsTask,
GetMessagesTask,
ServerConnectionWatchdogTask,
)
from gotify_tray.utils import verify_server
from PyQt6 import QtCore, QtGui, QtWidgets
@@ -112,6 +113,10 @@ class MainWindow(QtWidgets.QMainWindow):
closed_callback=self.listener_closed_callback,
)
self.watchdog = ServerConnectionWatchdogTask(self.gotify_client)
self.watchdog.closed.connect(lambda: self.listener_closed_callback(None, None))
self.watchdog.start()
self.link_callbacks()
self.show()