Commit ec873e68 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Update code style.

Set socket timeout to 15 min. (900'000 ms)
parent 98810ff7
Pipeline #28668 passed with stages
in 3 minutes and 46 seconds
......@@ -24,6 +24,7 @@ import org.apache.logging.log4j.LogManager
import org.elasticsearch.client.RestClient
import org.elasticsearch.client.RestHighLevelClient
class Service(file: String = "app.yml") {
companion object {
const val baseName = "indexer-"
......@@ -32,7 +33,7 @@ class Service(file: String = "app.yml") {
const val elasticPort = "elastic.port"
const val elasticHost = "elastic.host"
fun getRandomReportId() : String {
fun getRandomReportId(): String {
val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9')
return (1..10)
.map { allowedChars.random() }
......@@ -62,7 +63,11 @@ class Service(file: String = "app.yml") {
private val client = RestHighLevelClient(
RestClient.builder(
HttpHost(es.getProperty(elasticHost), es.getProperty(elasticPort).toInt())
)
).setRequestConfigCallback { requestConfigBuilder ->
requestConfigBuilder
.setConnectTimeout(5000)
.setSocketTimeout(900000)
}
)
private val processor = BulkProcessor(consumer, producer, index, client, baseName + index, log)
......
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