more keyboards
This commit is contained in:
@@ -123,7 +123,14 @@ func (o *OpenAIAPI) DoRequest(url string, params any) ([]byte, error) {
|
||||
if res.StatusCode == 504 || res.StatusCode == 400 || res.StatusCode == 502 {
|
||||
o.Logger.Warn(fmt.Sprintf("[%d] %s", res.StatusCode, res.Status))
|
||||
time.Sleep(5 * time.Second)
|
||||
return o.DoRequest(url, params)
|
||||
res, err = o.client.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
if res.StatusCode == 504 || res.StatusCode == 400 || res.StatusCode == 502 {
|
||||
return nil, fmt.Errorf("[%d] %s", res.StatusCode, res.Status)
|
||||
}
|
||||
}
|
||||
responseBody, err = io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user