Skip to content

Commit

Permalink
[usage] fix reconcilation (#18819)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenefftinge authored Sep 27, 2023
1 parent 6fce846 commit f26950b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/usage/pkg/apiv1/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ func (s *BillingService) ReconcileStripeCustomers(ctx context.Context) error {
log.Infof("Reconciling stripe invoices for cost center %s", costCenter.ID)
err := s.reconcileStripeInvoices(ctx, costCenter.ID)
if err != nil {
return err
log.WithError(err).Errorf("Failed to reconcile stripe invoices for cost center %s", costCenter.ID)
continue
}
_, err = s.ccManager.IncrementBillingCycle(ctx, costCenter.ID)
if err != nil {
Expand All @@ -370,7 +371,7 @@ func (s *BillingService) reconcileStripeInvoices(ctx context.Context, id db.Attr
}
for _, invoice := range invoices {
if invoice.Status == "paid" {
usage, err := InternalComputeInvoiceUsage(ctx, invoice, invoice.Customer)
usage, err := InternalComputeInvoiceUsage(ctx, invoice, cust)
if err != nil {
return err
}
Expand Down

0 comments on commit f26950b

Please sign in to comment.