Skip to content

Commit d78c447

Browse files
committed
routing: add context to reloadPayment method
1 parent 081845a commit d78c447

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
@@ -239,7 +239,7 @@ lifecycle:
239239
}
240240

241241
// We update the payment state on every iteration.
242-
currentPayment, ps, err := p.reloadPayment()
242+
currentPayment, ps, err := p.reloadPayment(ctx)
243243
if err != nil {
244244
return exitWithErr(err)
245245
}
@@ -1143,11 +1143,10 @@ func (p *paymentLifecycle) reloadInflightAttempts(
11431143
}
11441144

11451145
// reloadPayment returns the latest payment found in the db (control tower).
1146-
func (p *paymentLifecycle) reloadPayment() (paymentsdb.DBMPPayment,
1146+
func (p *paymentLifecycle) reloadPayment(
1147+
ctx context.Context) (paymentsdb.DBMPPayment,
11471148
*paymentsdb.MPPaymentState, error) {
11481149

1149-
ctx := context.TODO()
1150-
11511150
// Read the db to get the latest state of the payment.
11521151
payment, err := p.router.cfg.Control.FetchPayment(ctx, p.identifier)
11531152
if err != nil {

0 commit comments

Comments
 (0)