Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
294dc8d8
authored
Nov 27, 2023
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复tts异常时仍然扣费的问题
parent
5b2218c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
controller/relay-audio.go
+5
-0
controller/relay-image.go
+5
-0
No files found.
controller/relay-audio.go
View file @
294dc8d8
...
@@ -129,6 +129,11 @@ func relayAudioHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
...
@@ -129,6 +129,11 @@ func relayAudioHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
if
err
!=
nil
{
if
err
!=
nil
{
return
errorWrapper
(
err
,
"close_request_body_failed"
,
http
.
StatusInternalServerError
)
return
errorWrapper
(
err
,
"close_request_body_failed"
,
http
.
StatusInternalServerError
)
}
}
if
resp
.
StatusCode
!=
http
.
StatusOK
{
return
relayErrorHandler
(
resp
)
}
var
audioResponse
AudioResponse
var
audioResponse
AudioResponse
defer
func
(
ctx
context
.
Context
)
{
defer
func
(
ctx
context
.
Context
)
{
...
...
controller/relay-image.go
View file @
294dc8d8
...
@@ -147,6 +147,11 @@ func relayImageHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
...
@@ -147,6 +147,11 @@ func relayImageHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
if
err
!=
nil
{
if
err
!=
nil
{
return
errorWrapper
(
err
,
"close_request_body_failed"
,
http
.
StatusInternalServerError
)
return
errorWrapper
(
err
,
"close_request_body_failed"
,
http
.
StatusInternalServerError
)
}
}
if
resp
.
StatusCode
!=
http
.
StatusOK
{
return
relayErrorHandler
(
resp
)
}
var
textResponse
ImageResponse
var
textResponse
ImageResponse
defer
func
(
ctx
context
.
Context
)
{
defer
func
(
ctx
context
.
Context
)
{
if
consumeQuota
{
if
consumeQuota
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment