Skip to content

Commit

Permalink
[usage] fix gorm error (#18822)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenefftinge authored Sep 27, 2023
1 parent b21828b commit b41fa01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/usage/pkg/apiv1/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func (s *BillingService) reconcileStripeInvoices(ctx context.Context, id db.Attr
}
// check if a usage entry exists for this invoice
var existingUsage db.Usage
result := s.conn.First(existingUsage, "description = ?", usage.Description)
result := s.conn.First(&existingUsage, "description = ?", usage.Description)
if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
log.Infof("No usage entry found for invoice %s. Inserting one now.", invoice.ID)
Expand Down

0 comments on commit b41fa01

Please sign in to comment.