refactor: improve channel base URL handling and enhance RelayInfo logging

This commit is contained in:
CaIon
2025-08-14 22:15:18 +08:00
parent 112de0b6a6
commit f6f9e73fa3
5 changed files with 92 additions and 10 deletions

View File

@@ -133,13 +133,13 @@ func Relay(c *gin.Context, relayFormat types.RelayFormat) {
return
}
preConsumedQuota, newApiErr := service.PreConsumeQuota(c, priceData.ShouldPreConsumedQuota, relayInfo)
if newApiErr != nil {
preConsumedQuota, newAPIError := service.PreConsumeQuota(c, priceData.ShouldPreConsumedQuota, relayInfo)
if newAPIError != nil {
return
}
defer func() {
if newApiErr != nil {
if newAPIError != nil {
service.ReturnPreConsumedQuota(c, relayInfo, preConsumedQuota)
}
}()