From dfc9c5444ce7a8e6b97970fb94559250087154c4 Mon Sep 17 00:00:00 2001 From: "markiian.babiak" Date: Wed, 12 Mar 2025 15:44:43 -0400 Subject: [PATCH] CK-Monitor Socket Updates --- .../ck-monitor/ck-monitor.component.ts | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/components/ck-monitor/ck-monitor.component.ts b/frontend/src/app/components/ck-monitor/ck-monitor.component.ts index b0bf780f..b8f2e5b6 100644 --- a/frontend/src/app/components/ck-monitor/ck-monitor.component.ts +++ b/frontend/src/app/components/ck-monitor/ck-monitor.component.ts @@ -677,28 +677,29 @@ export class CkMonitorComponent implements OnInit, OnDestroy { SocketEvent.WORKFLOW_PROGRESS_UPDATE, async (updates) => { const found = updates.find( - (u) => u.workflow.workflowID == this.runningTask?.workflowID + (u) => u.workflowID == this.runningTask?.workflowID ); if (found) { const groupTasks = await this.workflowService.getGroupTasksByWorkflow( - found.workflow.workflowID, + found.workflowID, 'expanded' ); - groupTasks.sort((a, b) => - this._calcGroupProgress(a) > this._calcGroupProgress(b) ? -1 : 1 - ); - this.taskWorkflowGroupMap.set(found.workflow, groupTasks); - this.runningTask = found.workflow; - this.runningTaskGroupStatus = GroupTaskStatus.ACTIVE; - const progressData = await this._calcAverageProgress(groupTasks); - await this.updateRunningTaskDataSource( - found.workflow, - GroupTaskStatus.ACTIVE - ); - this.minGroupProgress = progressData[0]; - this.averageGroupProgress = progressData[1]; - this.maxGroupProgress = progressData[2]; + if ( + this.runningTask && + this.runningTask?.workflowID == found.workflowID + ) { + this.taskWorkflowGroupMap.set(this.runningTask, groupTasks); + const progressData = await this._calcAverageProgress(groupTasks); + await this.updateRunningTaskDataSource( + this.runningTask, + GroupTaskStatus.ACTIVE + ); + + this.minGroupProgress = progressData[0]; + this.averageGroupProgress = progressData[1]; + this.maxGroupProgress = progressData[2]; + } } } )