mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-16 16:13:56 +00:00
feat: able to set RELAY_TIMEOUT
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
Reference in New Issue
Block a user