Skip to content

Commit

Permalink
Merge pull request #1980 from slntopp/delays
Browse files Browse the repository at this point in the history
add delays to invoices cron
  • Loading branch information
coddmeistr authored Jan 23, 2025
2 parents 57d7b84 + c2cc012 commit 883566d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/billing/cron_expired_balance_invoices_term.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (s *BillingServiceServer) DeleteExpiredBalanceInvoicesCronJob(ctx context.C
log.Error("Failed to terminate expired balance invoice", zap.Error(err))
continue
}
delaySeconds(20)
count++
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/billing/cron_renew_invoices_issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func (s *BillingServiceServer) createRenewalInvoice(ctx context.Context, log *za
log.Error("Error creating invoice", zap.Error(err))
return fmt.Errorf("error creating invoice: %w", err)
}
delaySeconds(5)
delaySeconds(61)

log.Info("Created invoice", zap.String("uuid", resp.Msg.GetUuid()), zap.Int("item_count", len(inv.Items)))
return nil
Expand Down

0 comments on commit 883566d

Please sign in to comment.