mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-27 22:18:38 +00:00
fix: dalle log 显示张数 N
This commit is contained in:
@@ -277,14 +277,13 @@ func shouldRetry(c *gin.Context, openaiErr *types.NewAPIError, retryTimes int) b
|
|||||||
|
|
||||||
func processChannelError(c *gin.Context, channelError types.ChannelError, err *types.NewAPIError) {
|
func processChannelError(c *gin.Context, channelError types.ChannelError, err *types.NewAPIError) {
|
||||||
logger.LogError(c, fmt.Sprintf("relay error (channel #%d, status code: %d): %s", channelError.ChannelId, err.StatusCode, err.Error()))
|
logger.LogError(c, fmt.Sprintf("relay error (channel #%d, status code: %d): %s", channelError.ChannelId, err.StatusCode, err.Error()))
|
||||||
|
// 不要使用context获取渠道信息,异步处理时可能会出现渠道信息不一致的情况
|
||||||
gopool.Go(func() {
|
// do not use context to get channel info, there may be inconsistent channel info when processing asynchronously
|
||||||
// 不要使用context获取渠道信息,异步处理时可能会出现渠道信息不一致的情况
|
if service.ShouldDisableChannel(channelError.ChannelId, err) && channelError.AutoBan {
|
||||||
// do not use context to get channel info, there may be inconsistent channel info when processing asynchronously
|
gopool.Go(func() {
|
||||||
if service.ShouldDisableChannel(channelError.ChannelId, err) && channelError.AutoBan {
|
|
||||||
service.DisableChannel(channelError, err.Error())
|
service.DisableChannel(channelError, err.Error())
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
|
|
||||||
if constant.ErrorLogEnabled && types.IsRecordErrorLog(err) {
|
if constant.ErrorLogEnabled && types.IsRecordErrorLog(err) {
|
||||||
// 保存错误日志到mysql中
|
// 保存错误日志到mysql中
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ func ImageHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *type
|
|||||||
var logContent string
|
var logContent string
|
||||||
|
|
||||||
if len(request.Size) > 0 {
|
if len(request.Size) > 0 {
|
||||||
logContent = fmt.Sprintf("大小 %s, 品质 %s", request.Size, quality)
|
logContent = fmt.Sprintf("大小 %s, 品质 %s, 张数 %d", request.Size, quality, request.N)
|
||||||
}
|
}
|
||||||
|
|
||||||
postConsumeQuota(c, info, usage.(*dto.Usage), logContent)
|
postConsumeQuota(c, info, usage.(*dto.Usage), logContent)
|
||||||
|
|||||||
Reference in New Issue
Block a user