routing: add context to reloadPayment method

This commit is contained in:
ziggie committed 2026-02-25 08:02:25 +01:00
1 parent 03d891d52d
commit 4cc5428087
1 file changed
+3 -4
+3 -4
View File
@@ -250,7 +250,7 @@ lifecycle:
}
// We update the payment state on every iteration.
currentPayment, ps, err := p.reloadPayment()
currentPayment, ps, err := p.reloadPayment(cleanupCtx)
if err != nil {
return exitWithErr(err)
}
@@ -1163,11 +1163,10 @@ func (p *paymentLifecycle) reloadInflightAttempts(
}
// reloadPayment returns the latest payment found in the db (control tower).
func (p *paymentLifecycle) reloadPayment() (paymentsdb.DBMPPayment,
func (p *paymentLifecycle) reloadPayment(
ctx context.Context) (paymentsdb.DBMPPayment,
*paymentsdb.MPPaymentState, error) {
ctx := context.TODO()
// Read the db to get the latest state of the payment.
payment, err := p.router.cfg.Control.FetchPayment(ctx, p.identifier)
if err != nil {