Skip to content

Commit

Permalink
[Bug] [Alert] The alarm list is not sorted by alarm time datavane#565
Browse files Browse the repository at this point in the history
  • Loading branch information
hawk9821 committed May 27, 2024
1 parent dbe9b19 commit 16a1fbd
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
public class ClusterAlertHistoryServiceImpl extends ServiceImpl<ClusterAlertHistoryMapper, ClusterAlertHistory>
implements
ClusterAlertHistoryService {

private static final Logger logger = LoggerFactory.getLogger(ClusterAlertHistoryServiceImpl.class);

@Autowired
private ClusterServiceRoleInstanceService roleInstanceService;

@Autowired
private ClusterInfoService clusterInfoService;

@Override
public void saveAlertHistory(String alertMessage) {
logger.warn("Receive Alert Message : {}", alertMessage);
Expand All @@ -71,7 +71,7 @@ public void saveAlertHistory(String alertMessage) {
ActorUtils.actorSystem.dispatcher(),
ActorRef.noSender());
}

@Override
public Result getAlertList(Integer serviceInstanceId) {
List<ClusterAlertHistory> list = this.list(new QueryWrapper<ClusterAlertHistory>()
Expand All @@ -80,7 +80,7 @@ public Result getAlertList(Integer serviceInstanceId) {
.orderByDesc(Constants.CREATE_TIME));
return Result.success(list);
}

@Override
public Result getAllAlertList(Integer clusterId, Integer page, Integer pageSize) {
int offset = (page - 1) * pageSize;
Expand All @@ -94,7 +94,7 @@ public Result getAllAlertList(Integer clusterId, Integer page, Integer pageSize)
.eq(Constants.IS_ENABLED, 1));
return Result.success(list).put(Constants.TOTAL, count);
}

@Override
public void removeAlertByRoleInstanceIds(List<Integer> ids) {
ClusterServiceRoleInstanceEntity roleInstanceEntity = roleInstanceService.getById(ids.get(0));
Expand Down

0 comments on commit 16a1fbd

Please sign in to comment.