mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 23:43:27 +01:00
Remove hidden feature HTTP_CLIENT_TIMEOUT_IN_SECONDS
This commit is contained in:
parent
fc0c3499f4
commit
35c33620a5
@ -7,8 +7,6 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/smtp"
|
"net/smtp"
|
||||||
"os"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -27,16 +25,6 @@ var (
|
|||||||
httpTimeout = 10 * time.Second
|
httpTimeout = 10 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
// XXX: This is an undocumented feature. See https://github.com/TwinProduction/gatus/issues/104.
|
|
||||||
httpTimeoutInSecondsFromEnvironmentVariable := os.Getenv("HTTP_CLIENT_TIMEOUT_IN_SECONDS")
|
|
||||||
if len(httpTimeoutInSecondsFromEnvironmentVariable) > 0 {
|
|
||||||
if httpTimeoutInSeconds, err := strconv.Atoi(httpTimeoutInSecondsFromEnvironmentVariable); err == nil {
|
|
||||||
httpTimeout = time.Duration(httpTimeoutInSeconds) * time.Second
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetHTTPClient returns the shared HTTP client
|
// GetHTTPClient returns the shared HTTP client
|
||||||
func GetHTTPClient(insecure bool) *http.Client {
|
func GetHTTPClient(insecure bool) *http.Client {
|
||||||
if insecure {
|
if insecure {
|
||||||
|
Loading…
Reference in New Issue
Block a user