Skip to content

Commit 5053821

Browse files
committed
routing: add context to reloadPayment method
1 parent 3ca0ee2 commit 5053821

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
@@ -250,7 +250,7 @@ lifecycle:
250250
}
251251

252252
// We update the payment state on every iteration.
253-
currentPayment, ps, err := p.reloadPayment()
253+
currentPayment, ps, err := p.reloadPayment(cleanupCtx)
254254
if err != nil {
255255
return exitWithErr(err)
256256
}
@@ -1163,11 +1163,10 @@ func (p *paymentLifecycle) reloadInflightAttempts(
11631163
}
11641164

11651165
// reloadPayment returns the latest payment found in the db (control tower).
1166-
func (p *paymentLifecycle) reloadPayment() (paymentsdb.DBMPPayment,
1166+
func (p *paymentLifecycle) reloadPayment(
1167+
ctx context.Context) (paymentsdb.DBMPPayment,
11671168
*paymentsdb.MPPaymentState, error) {
11681169

1169-
ctx := context.TODO()
1170-
11711170
// Read the db to get the latest state of the payment.
11721171
payment, err := p.router.cfg.Control.FetchPayment(ctx, p.identifier)
11731172
if err != nil {

0 commit comments

Comments
 (0)