Skip to content

Commit ecd0eb6

Browse files
committed
routing: add context to reloadPayment method
1 parent 93d3753 commit ecd0eb6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

routing/payment_lifecycle.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ lifecycle:
243243
}
244244

245245
// We update the payment state on every iteration.
246-
currentPayment, ps, err := p.reloadPayment()
246+
currentPayment, ps, err := p.reloadPayment(ctx)
247247
if err != nil {
248248
return exitWithErr(err)
249249
}
@@ -1154,11 +1154,10 @@ func (p *paymentLifecycle) reloadInflightAttempts(
11541154
}
11551155

11561156
// reloadPayment returns the latest payment found in the db (control tower).
1157-
func (p *paymentLifecycle) reloadPayment() (paymentsdb.DBMPPayment,
1157+
func (p *paymentLifecycle) reloadPayment(
1158+
ctx context.Context) (paymentsdb.DBMPPayment,
11581159
*paymentsdb.MPPaymentState, error) {
11591160

1160-
ctx := context.TODO()
1161-
11621161
// Read the db to get the latest state of the payment.
11631162
payment, err := p.router.cfg.Control.FetchPayment(ctx, p.identifier)
11641163
if err != nil {

0 commit comments

Comments
 (0)