diff --git a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/Application.java b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/Application.java index e019d87c..7f70642a 100644 --- a/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/Application.java +++ b/src/main/java/org/heigit/bigspatialdata/ohsome/ohsomeapi/Application.java @@ -48,6 +48,7 @@ public void run(ApplicationArguments args) throws Exception { boolean multithreading = true; boolean caching = false; String dbPrefix = null; + long timeout = 100000; // only used when tests are executed directly in Eclipse if (System.getProperty("database.db") != null) { DbConnData.db = new OSHDBH2(System.getProperty("database.db")); @@ -98,6 +99,8 @@ public void run(ApplicationArguments args) throws Exception { case "database.prefix": dbPrefix = args.getOptionValues(paramName).get(0); break; + case "database.timeout": + timeout = Long.valueOf(args.getOptionValues(paramName).get(0)); default: break; } @@ -127,6 +130,7 @@ public void run(ApplicationArguments args) throws Exception { DbConnData.mapTagTranslator = new RemoteTagTranslator(DbConnData.tagTranslator); } if (DbConnData.db instanceof OSHDBIgnite) { + ((OSHDBIgnite) DbConnData.db).timeoutInMilliseconds(timeout); RemoteTagTranslator mtt = DbConnData.mapTagTranslator; ((OSHDBIgnite) DbConnData.db).onClose(() -> { try {