Commit 1dbdf91b authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

fix timeout exception

parent 9a8a808c
......@@ -349,7 +349,7 @@ public class JsonFromPUA {
ElementProperties children = new ElementProperties();
children.setName(realName);
children.setId(idCounter++);
children.setParent(parent);
//children.setParent(parent);
children.setParentId(parent.getId());
children.setLevel(parent.getLevel() + 1);
parent.getChildren().add(children);
......
......@@ -173,20 +173,14 @@ public class PastisService {
}
public ProfileResponse createProfile(String type) throws TechnicalException, NoSuchAlgorithmException {
Resource resource = null;
Resource resource;
ProfileResponse profileResponse = null;
if (type != null && !type.isEmpty()) {
ProfileType profileType = ProfileType.valueOf(type);
if (type.equals(ProfileType.PA.getType())) {
resource = new ClassPathResource(rngFile);
} else {
try {
FileInputStream fileInputStream = new FileInputStream("/vitamui/data/pastis-external/AUP_default_PASTIS.json");
resource = new InputStreamResource(fileInputStream);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
//resource = new ClassPathResource(jsonFile);
resource = new ClassPathResource(jsonFile);
}
profileResponse = createProfileByType(resource, profileType);
}
......@@ -279,9 +273,6 @@ public class PastisService {
} catch (AssertionError ae) {
throw new TechnicalException("Failed to load pua ", ae);
}
profileResponse.setId(String.valueOf((Math.abs((this.rand.nextLong()) / 1000) != 0)));
return profileResponse;
}
......@@ -325,8 +316,6 @@ public class PastisService {
throw new TechnicalException("Failed to load pua ", ae);
}
profileResponse.setId(String.valueOf((Math.abs((this.rand.nextLong()) / 1000) != 0)));
return profileResponse;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment