routerrpc: add verbose log and ignore context canceled error

This commit is contained in:
yyforyongyu 2024-01-05 22:18:25 +08:00
parent 58677569b5
commit 6de21b2a02
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

@ -872,10 +872,17 @@ func (s *Server) trackPayment(subscription routing.ControlTowerSubscriber,
stream.Context(), subscription, noInflightUpdates, stream.Send,
)
// If the context is canceled, we don't return an error.
if errors.Is(err, context.Canceled) {
log.Debugf("Payment stream %v canceled", identifier)
log.Infof("Payment stream %v canceled", identifier)
return nil
}
// Otherwise, we will log and return the error as the stream has
// received an error from the payment lifecycle.
log.Errorf("TrackPayment got error for payment %x: %v", identifier, err)
return err
}