修改:hpc代码优化
This commit is contained in:
@@ -72,6 +72,9 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
|
||||
String currentNodeId =execution.getCurrentActivityId();
|
||||
String masterFileRegularStr = config.getMasterFileRegularStr();
|
||||
String inputFilesRegularStr = config.getInputFilesRegularStr();
|
||||
if(StringUtils.isBlank(masterFileRegularStr)){
|
||||
throw new RuntimeException("Hpc任务执行失败,主求解文件规则不能是空");
|
||||
}
|
||||
CoreLogger.info("beforeNodeId:{},currentNodeId:{},masterFileRegularStr:{},inputFilesRegularStr:{}",beforeNodeId,currentNodeId,masterFileRegularStr,inputFilesRegularStr);
|
||||
// 初始化用户/租户信息
|
||||
initUserInfo(execution);
|
||||
@@ -138,6 +141,13 @@ public class HpcHandler implements ExecutionHandler<Map<String, Object>,HPCExecu
|
||||
Long userId = (Long) execution.getVariable("userId");
|
||||
String userName = (String) execution.getVariable("userName");
|
||||
Long tenantId = (Long) execution.getVariable("tenantId");
|
||||
log.info("Hpc流程发起,用户id:{},租户id:{}",userId,tenantId);
|
||||
if(Objects.isNull(tenantId)){
|
||||
tenantId=ThreadLocalContext.getTenantId();
|
||||
}
|
||||
if(Objects.isNull(userId)){
|
||||
tenantId=ThreadLocalContext.getUserId();
|
||||
}
|
||||
ThreadLocalContext.setUserId(userId);
|
||||
ThreadLocalContext.setUserName(userName);
|
||||
ThreadLocalContext.setTenantId(tenantId);
|
||||
|
||||
@@ -153,7 +153,7 @@ public class PbsServiceDecorator implements IPbsServiceDecorator {
|
||||
if (response.isSuccess() && StringUtils.isNotEmpty(response.getData())) {
|
||||
jobId = response.getData();
|
||||
}
|
||||
if(StringUtils.isNotEmpty(jobId)){
|
||||
if(StringUtils.isBlank(jobId)){
|
||||
log.error("Hpc执行失败返回结果:{}",JSONObject.toJSONString(response));
|
||||
throw new RuntimeException("Hpc执行失败,返回jobId空");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user