wilmerdooley commented on code in PR #4154:
URL: https://github.com/apache/hertzbeat/pull/4154#discussion_r3408621242


##########
hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java:
##########
@@ -431,12 +431,6 @@ public void modifyMonitor(Monitor monitor, List<Param> 
params, String collector,
                 newJobId = 
collectJobScheduling.updateAsyncCollectJob(appDefine, collector);
             }
             monitor.setJobId(newJobId);
-

Review Comment:
   We resolved this by setting the status of the updated monitor object to the 
existing preMonitor status using `monitor.setStatus(preMonitor.getStatus())` 
right before saving. This ensures that the real-time status updates are not 
overwritten during modifications. A corresponding unit test 
`testModifyMonitorPreservesLiveStatus` has also been added to verify this 
behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to