mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
(fix)(headless)Fix updating measure agg doesn't take effect.
This commit is contained in:
@@ -104,11 +104,11 @@ public class MetricServiceImpl extends ServiceImpl<MetricDOMapper, MetricDO>
|
||||
} else {
|
||||
MetricResp metricRespByBizName = bizNameMap.get(metric.getBizName());
|
||||
MetricResp metricRespByName = nameMap.get(metric.getName());
|
||||
if (null != metricRespByBizName && isChange(metric, metricRespByBizName)) {
|
||||
if (null != metricRespByBizName) {
|
||||
metric.setId(metricRespByBizName.getId());
|
||||
this.updateMetric(metric, user);
|
||||
} else {
|
||||
if (null != metricRespByName && isChange(metric, metricRespByName)) {
|
||||
if (null != metricRespByName) {
|
||||
metric.setId(metricRespByName.getId());
|
||||
this.updateMetric(metric, user);
|
||||
}
|
||||
@@ -819,7 +819,7 @@ public class MetricServiceImpl extends ServiceImpl<MetricDOMapper, MetricDO>
|
||||
return modelResps.stream().map(ModelResp::getId).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
private boolean isChange(MetricReq metricReq, MetricResp metricResp) {
|
||||
private boolean isNameChange(MetricReq metricReq, MetricResp metricResp) {
|
||||
boolean isNameChange = !metricReq.getName().equals(metricResp.getName());
|
||||
return isNameChange;
|
||||
}
|
||||
|
||||
@@ -142,8 +142,12 @@ public class ModelServiceImpl implements ModelService {
|
||||
@Override
|
||||
@Transactional
|
||||
public ModelResp updateModel(ModelReq modelReq, User user) throws Exception {
|
||||
// checkParams(modelReq);
|
||||
// Comment out below checks for now, they seem unnecessary and
|
||||
// lead to unexpected exception in updating model
|
||||
/*
|
||||
checkParams(modelReq);
|
||||
checkRelations(modelReq);
|
||||
*/
|
||||
ModelDO modelDO = modelRepository.getModelById(modelReq.getId());
|
||||
ModelConverter.convert(modelDO, modelReq, user);
|
||||
modelRepository.updateModel(modelDO);
|
||||
|
||||
Reference in New Issue
Block a user