Skip to content

Commit 4199dd0

Browse files
committed
Added the usage of the HobbitConfiguraiton class instead of accessing system properties.
1 parent 96ad3c8 commit 4199dd0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

platform-controller/src/main/java/org/hobbit/controller/ExperimentManager.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,7 @@ protected ExperimentManager(PlatformController controller, HobbitConfiguration h
143143
this.hobbitConfig = hobbitConfig;
144144

145145
try {
146-
// TODO environment variable should have been used there
147-
// TODO global static method in hobbit core for retrieving values like this
148-
defaultMaxExecutionTime = Long
149-
.parseLong(System.getProperty("MAX_EXECUTION_TIME", Long.toString(DEFAULT_MAX_EXECUTION_TIME)));
146+
defaultMaxExecutionTime = hobbitConfig.getLong("MAX_EXECUTION_TIME", 1200000L, LOGGER);
150147
} catch (Exception e) {
151148
LOGGER.debug("Could not get execution time from env, using default value..");
152149
}
@@ -329,7 +326,7 @@ protected static Map<String, Object> getHardwareConstraints(String serializedBen
329326
return Collections.emptyMap();
330327
}
331328

332-
private void createRabbitMQ(ExperimentConfiguration config) throws Exception {
329+
protected void createRabbitMQ(ExperimentConfiguration config) throws Exception {
333330
String rabbitMQAddress = hobbitConfig.getString(RABBIT_MQ_EXPERIMENTS_HOST_NAME_KEY, (String) null);
334331
if (rabbitMQAddress == null) {
335332
LOGGER.info("Starting new RabbitMQ for the experiment...");

0 commit comments

Comments
 (0)