move log line

This commit is contained in:
kiwiidb
2023-11-07 16:09:53 +09:00
parent 1482240d0a
commit a64cd2d184
3 changed files with 4 additions and 1 deletions

View File

@@ -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)

View File

@@ -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)
}
}

View File

@@ -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 {