mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-04 13:17:50 +08:00
Merge pull request #1618 from samz406/1227-2
before delete Udf check exist
This commit is contained in:
commit
4032c4e64b
@ -187,6 +187,12 @@ public class UdfFuncService extends BaseService{
|
||||
// verify udfFunc is exist
|
||||
UdfFunc udf = udfFuncMapper.selectUdfById(udfFuncId);
|
||||
|
||||
if (udf == null) {
|
||||
result.put(Constants.STATUS, Status.UDF_FUNCTION_NOT_EXIST);
|
||||
result.put(Constants.MSG, Status.UDF_FUNCTION_NOT_EXIST.getMsg());
|
||||
return result;
|
||||
}
|
||||
|
||||
// if resource upload startup
|
||||
if (!PropertyUtils.getResUploadStartupState()){
|
||||
logger.error("resource upload startup state: {}", PropertyUtils.getResUploadStartupState());
|
||||
@ -194,12 +200,6 @@ public class UdfFuncService extends BaseService{
|
||||
return result;
|
||||
}
|
||||
|
||||
if (udf == null) {
|
||||
result.put(Constants.STATUS, Status.UDF_FUNCTION_NOT_EXIST);
|
||||
result.put(Constants.MSG, Status.UDF_FUNCTION_NOT_EXIST.getMsg());
|
||||
return result;
|
||||
}
|
||||
|
||||
// verify udfFuncName is exist
|
||||
if (!funcName.equals(udf.getFuncName())) {
|
||||
if (checkUdfFuncNameExists(funcName)) {
|
||||
@ -303,7 +303,7 @@ public class UdfFuncService extends BaseService{
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result delete(int id) {
|
||||
Result result = new Result();
|
||||
|
||||
|
||||
udfFuncMapper.deleteById(id);
|
||||
udfUserMapper.deleteByUdfFuncId(id);
|
||||
putMsg(result, Status.SUCCESS);
|
||||
|
Loading…
Reference in New Issue
Block a user