Browse Source

Determine when the user's tenant does not exist

pull/2/head
lgcareer 5 years ago
parent
commit
9a4cb31451
  1. 12
      escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java

12
escheduler-api/src/main/java/cn/escheduler/api/service/UsersService.java

@ -307,11 +307,13 @@ public class UsersService extends BaseService {
// delete user
User user = userMapper.queryTenantCodeByUserId(id);
if (PropertyUtils.getResUploadStartupState()){
String userPath = HadoopUtils.getHdfsDataBasePath() + "/" + user.getTenantCode() + "/home/" + id;
HadoopUtils.getInstance().delete(userPath, true);
if (user != null) {
if (PropertyUtils.getResUploadStartupState()) {
String userPath = HadoopUtils.getHdfsDataBasePath() + "/" + user.getTenantCode() + "/home/" + id;
if (HadoopUtils.getInstance().exists(userPath)) {
HadoopUtils.getInstance().delete(userPath, true);
}
}
}
userMapper.delete(id);

Loading…
Cancel
Save