Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
j.hoerdt
sensor2graph
Commits
e0be57d6
Commit
e0be57d6
authored
Nov 23, 2021
by
neop
Browse files
try large timeouts
parent
1532c34a
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/sensor2graph/Main.java
View file @
e0be57d6
...
...
@@ -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
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment