mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-10 10:33:41 +08:00
Enhance logging and error handling in processing logic
- Enhance logging by including requested image counts for improved tracking. - Implement user quota validation before processing image requests. - Improve error handling for model validation and JSON unmarshalling in billing processes.
This commit is contained in:
@@ -226,7 +226,8 @@ func RelayImageHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
|
||||
}
|
||||
if quota >= 0 {
|
||||
tokenName := c.GetString(ctxkey.TokenName)
|
||||
logContent := fmt.Sprintf("model rate %.2f, group rate %.2f", modelRatio, groupRatio)
|
||||
logContent := fmt.Sprintf("model rate %.2f, group rate %.2f, num %d",
|
||||
modelRatio, groupRatio, imageRequest.N)
|
||||
model.RecordConsumeLog(ctx, &model.Log{
|
||||
UserId: meta.UserId,
|
||||
ChannelId: meta.ChannelId,
|
||||
|
||||
Reference in New Issue
Block a user