Commit e0be57d6 authored by neop's avatar neop
Browse files

try large timeouts

parent 1532c34a
......@@ -5,6 +5,8 @@ import com.influxdb.client.*;
import org.neo4j.driver.*;
import org.neo4j.driver.Config.*;
import okhttp3.OkHttpClient;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
......@@ -73,12 +75,23 @@ public class Main {
}
private static void initialize_influxdb_driver() {
influxDBClient = InfluxDBClientFactory.createV1(
Main.influxdb_uri,
System.getenv("SENSOR2GRAPH_INFLUXDB_USER"),
System.getenv("SENSOR2GRAPH_INFLUXDB_PASS").toCharArray(),
influxdb_database_name,
null
// inspired by https://github.com/influxdata/influxdb-client-java/blob/86bda85ca6f0acf5bdea9883645f47e93d501003/client/src/main/java/com/influxdb/client/InfluxDBClientFactory.java#L173 with added timeout
influxDBClient = InfluxDBClientFactory.create(
InfluxDBClientOptions.builder()
.url(Main.influxdb_uri)
.org("-")
.authenticateToken(String.format("%s:%s",
System.getenv("SENSOR2GRAPH_INFLUXDB_USER"),
System.getenv("SENSOR2GRAPH_INFLUXDB_PASS")
).toCharArray())
.bucket(influxdb_database_name)
.okHttpClient(
new OkHttpClient().newBuilder()
.connectTimeout(10, TimeUnit.MINUTES)
.readTimeout(10, TimeUnit.MINUTES)
.writeTimeout(10, TimeUnit.MINUTES)
)
.build()
).enableGzip();
}
......
Markdown is supported
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