if (CollectionUtils.isEmpty(rules)) {
return;
}
Long pipelineId = rules.get(0).getPipelineId();
Pipeline pipeline = pipelineService.findById(pipelineId);
PositionEventData data = arbitrateViewService.getCanalCursor(pipeline.getParameters().getDestinationName(),
pipeline.getParameters().getMainstemClientId());
// 如果处于stop状态,则忽略报警
ChannelStatus status = arbitrateManageService.channelEvent().status(pipeline.getChannelId());
if (status == null || status.isStop()) {
return;
}
long latestSyncTime = 0L;
if (data != null && data.getModifiedTime() != null) {
Date modifiedDate = data.getModifiedTime();
latestSyncTime = modifiedDate.getTime();
}
long now = System.currentTimeMillis();
long elapsed = now - latestSyncTime;