fix compileation eror

This commit is contained in:
androidlover5842
2026-01-26 14:56:52 +05:30
parent 9835435aab
commit 31398d3822
5 changed files with 30 additions and 26 deletions

View File

@@ -1,18 +1,18 @@
package com.android.trisolarisserver.config
import org.springframework.boot.web.client.RestTemplateBuilder
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.http.client.SimpleClientHttpRequestFactory
import org.springframework.web.client.RestTemplate
import java.time.Duration
@Configuration
class HttpConfig {
@Bean
fun restTemplate(builder: RestTemplateBuilder): RestTemplate {
return builder
.setConnectTimeout(Duration.ofSeconds(10))
.setReadTimeout(Duration.ofMinutes(5))
.build()
fun restTemplate(): RestTemplate {
val factory = SimpleClientHttpRequestFactory().apply {
setConnectTimeout(10_000)
setReadTimeout(5 * 60 * 1_000)
}
return RestTemplate(factory)
}
}