From d7399d2fa9aea0bb8744bd48ae589ef2dfba144f Mon Sep 17 00:00:00 2001 From: Sakari Ikonen <64256562+saikonen@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:49:26 +0300 Subject: [PATCH] add run heartbeat keepalive and broadcast logic to cover for missing updates from db (#441) --- services/ui_backend_service/api/notify.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/ui_backend_service/api/notify.py b/services/ui_backend_service/api/notify.py index 31f7f622..69d97332 100644 --- a/services/ui_backend_service/api/notify.py +++ b/services/ui_backend_service/api/notify.py @@ -95,6 +95,10 @@ async def handle_trigger_msg(self, msg: str): # Heartbeat watcher for Tasks. if table.table_name == self.db.task_table_postgres.table_name: self.event_emitter.emit('task-heartbeat', 'update', data) + # also keepalive for run heartbeats. + self.event_emitter.emit('run-heartbeat', 'update', data) + # also broadcast as a run heartbeat update, as otherwise these receive no updates + await _broadcast(self.event_emitter, "UPDATE", self.db.run_table_postgres.table_name, data) # Notify when Run parameters are ready. if operation == "INSERT" and \