chore: remove helper & util subpackage for relay

This commit is contained in:
JustSong
2024-04-06 01:50:12 +08:00
parent 24ed170e7b
commit f586ae0ad8
19 changed files with 221 additions and 215 deletions

24
relay/client/init.go Normal file
View File

@@ -0,0 +1,24 @@
package client
import (
"github.com/songquanpeng/one-api/common/config"
"net/http"
"time"
)
var HTTPClient *http.Client
var ImpatientHTTPClient *http.Client
func init() {
if config.RelayTimeout == 0 {
HTTPClient = &http.Client{}
} else {
HTTPClient = &http.Client{
Timeout: time.Duration(config.RelayTimeout) * time.Second,
}
}
ImpatientHTTPClient = &http.Client{
Timeout: 5 * time.Second,
}
}