feat: able to set RELAY_TIMEOUT

This commit is contained in:
JustSong committed 2023-10-22 20:39:49 +08:00
1 parent 0c7b132dde
commit 0e4f9e4690
3 files changed
+11 -1

No files matched your search

+8 -1
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,
}