Skip to content

Commit

Permalink
implementing timeout for ignite backend
Browse files Browse the repository at this point in the history
configurable via --database.timeout parameter on startup
default: 100000ms
  • Loading branch information
FabiKo117 committed Nov 2, 2018
1 parent 7b30da0 commit cc3061a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit cc3061a

Please sign in to comment.