feat: able to set RELAY_TIMEOUT

This commit is contained in:
JustSong
2023-10-22 20:39:49 +08:00
parent 63fafba112
commit 89d458b9cf
3 changed files with 11 additions and 1 deletions

View File

@@ -32,7 +32,14 @@ var httpClient *http.Client
var impatientHTTPClient *http.Client
func init() {
httpClient = &http.Client{}
if common.RelayTimeout == 0 {
httpClient = &http.Client{}
} else {
httpClient = &http.Client{
Timeout: time.Duration(common.RelayTimeout) * time.Second,
}
}
impatientHTTPClient = &http.Client{
Timeout: 5 * time.Second,
}