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 Jul 27, 2024
1 parent dcee3ab commit f63aceb
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 f63aceb

Please sign in to comment.