File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
logaccess/loki/src/main/kotlin Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ class LokiLogFileProvider(
6262 /* * The header to define the tenant ID in multi-tenant mode. */
6363 private const val TENANT_HEADER = " X-Scope-OrgID"
6464
65+ /* * Default value for HTTP client timeout in seconds */
66+ private const val HTTP_CLIENT_DEFAULT_TIMEOUT_SEC = 30
67+
6568 private val logger = LoggerFactory .getLogger(LokiLogFileProvider ::class .java)
6669
6770 /* *
@@ -195,10 +198,11 @@ class LokiLogFileProvider(
195198 }
196199 }
197200
198- config.timeoutSec?.also { timeout ->
199- install(HttpTimeout ) {
200- requestTimeoutMillis = timeout * 1000L
201- }
201+ install(HttpTimeout ) {
202+ val httpClientTimeoutMillis = (config.timeoutSec ? : HTTP_CLIENT_DEFAULT_TIMEOUT_SEC ) * 1000L
203+ requestTimeoutMillis = httpClientTimeoutMillis
204+ connectTimeoutMillis = httpClientTimeoutMillis
205+ socketTimeoutMillis = httpClientTimeoutMillis
202206 }
203207
204208 expectSuccess = true
You can’t perform that action at this time.
0 commit comments