From a64cd2d184763435fbe82526e5ff50d23df98549 Mon Sep 17 00:00:00 2001 From: kiwiidb Date: Tue, 7 Nov 2023 16:09:53 +0900 Subject: [PATCH] move log line --- cmd/payment-reconciliation/main.go | 3 +++ lib/service/background_routines.go | 1 + lib/service/checkpayments.go | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/payment-reconciliation/main.go b/cmd/payment-reconciliation/main.go index 6279900..0290e52 100644 --- a/cmd/payment-reconciliation/main.go +++ b/cmd/payment-reconciliation/main.go @@ -75,6 +75,9 @@ func main() { //for this job, we only search for payments older than a day to avoid current in-flight payments ts := time.Now().Add(-1 * 24 * time.Hour) pending, err := svc.GetPendingPaymentsUntil(startupCtx, ts) + svc.Logger.Infof("Found %d pending payments", len(pending)) + startupCtx, cancel := context.WithTimeout(startupCtx, 2*time.Minute) + defer cancel() err = svc.CheckPendingOutgoingPayments(startupCtx, pending) if err != nil { sentry.CaptureException(err) diff --git a/lib/service/background_routines.go b/lib/service/background_routines.go index 59921ef..075104c 100644 --- a/lib/service/background_routines.go +++ b/lib/service/background_routines.go @@ -31,6 +31,7 @@ func (svc *LndhubService) StartPendingPaymentRoutine(ctx context.Context) (err e if err != nil { return err } + svc.Logger.Infof("Found %d pending payments", len(pending)) return svc.CheckPendingOutgoingPayments(ctx, pending) } } diff --git a/lib/service/checkpayments.go b/lib/service/checkpayments.go index f9510a6..c7cb264 100644 --- a/lib/service/checkpayments.go +++ b/lib/service/checkpayments.go @@ -34,7 +34,6 @@ func (svc *LndhubService) GetAllPendingPayments(ctx context.Context) ([]models.I return payments, err } func (svc *LndhubService) CheckPendingOutgoingPayments(ctx context.Context, pendingPayments []models.Invoice) (err error) { - svc.Logger.Infof("Found %d pending payments", len(pendingPayments)) //call trackoutgoingpaymentstatus for each one var wg sync.WaitGroup for _, inv := range pendingPayments {