mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-09 15:43:41 +08:00
perf: reuse http client to reduce delay
This commit is contained in:
@@ -45,8 +45,7 @@ func testChannel(channel *model.Channel, request ChatRequest) (error, *OpenAIErr
|
||||
req.Header.Set("Authorization", "Bearer "+channel.Key)
|
||||
}
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
resp, err := httpClient.Do(req)
|
||||
if err != nil {
|
||||
return err, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user