Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Nov 10, 2023
1 parent daded5d commit d44cf7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manager/transhipment.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ func sendTranshipmentResponse(c *gin.Context, form TranshipmentForm, id string,

admin.AnalysisRequest(form.Model, buffer, err)
if err != nil {
globals.Warn(fmt.Sprintf("error from chat request api: %s", err.Error()))
auth.RevertSubscriptionUsage(utils.GetCacheFromContext(c), user, form.Model, plan)
globals.Warn(fmt.Sprintf("error from chat request api: %s (instance: %s, client: %s)", err, form.Model, c.ClientIP()))
}

CollectQuota(c, user, buffer, plan)
Expand Down Expand Up @@ -195,6 +196,7 @@ func sendStreamTranshipmentResponse(c *gin.Context, form TranshipmentForm, id st

admin.AnalysisRequest(form.Model, buffer, err)
if err != nil {
auth.RevertSubscriptionUsage(utils.GetCacheFromContext(c), user, form.Model, plan)
channel <- getStreamTranshipmentForm(id, created, form, fmt.Sprintf("Error: %s", err.Error()), buffer, true)
CollectQuota(c, user, buffer, plan)
close(channel)
Expand Down

0 comments on commit d44cf7a

Please sign in to comment.