Skip to content

Commit

Permalink
fix: rpm limit recore ignore empty channel id
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Jan 6, 2025
1 parent 9a7f5c1 commit 2baece4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions service/aiproxy/model/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ func BatchRecordConsume(
if err != nil {
errs = append(errs, fmt.Errorf("failed to update token used amount: %w", err))
}
err = UpdateChannelUsedAmount(channelID, amount, 1)
if err != nil {
errs = append(errs, fmt.Errorf("failed to update channel used amount: %w", err))
if channelID > 0 {
err = UpdateChannelUsedAmount(channelID, amount, 1)
if err != nil {
errs = append(errs, fmt.Errorf("failed to update channel used amount: %w", err))
}
}
if len(errs) == 0 {
return nil
Expand Down

0 comments on commit 2baece4

Please sign in to comment.