Skip to content

Commit

Permalink
поднял socket timeout на поиске
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Nov 3, 2024
1 parent b0bd510 commit ac0ae56
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 1998-2022 Linux.org.ru
* Copyright 1998-2024 Linux.org.ru
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -17,13 +17,19 @@ package ru.org.linux.search

import com.sksamuel.elastic4s.http.JavaClient
import com.sksamuel.elastic4s.{ElasticClient, ElasticProperties}
import org.apache.http.client.config.RequestConfig
import org.elasticsearch.client.RestClientBuilder.RequestConfigCallback
import org.springframework.context.annotation.{Bean, Configuration}
import ru.org.linux.spring.SiteConfig

@Configuration
class ElasticsearchConfiguration(config: SiteConfig) {
@Bean(destroyMethod = "close")
def client: ElasticClient = {
ElasticClient(JavaClient(ElasticProperties(config.getElasticsearch)))
ElasticClient(JavaClient(ElasticProperties(config.getElasticsearch), new RequestConfigCallback() {
override def customizeRequestConfig(requestConfigBuilder: RequestConfig.Builder): RequestConfig.Builder = {
requestConfigBuilder.setSocketTimeout(120000)
}
}))
}
}

0 comments on commit ac0ae56

Please sign in to comment.