mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-01-05 22:15:50 +01:00
Create the channels during the Subscribe function call and make them buffered
This commit is contained in:
@@ -36,8 +36,7 @@ func NewGrpcServer(svc *LndhubService, ctx context.Context) (*Server, error) {
|
||||
}
|
||||
|
||||
func (s *Server) SubsribeInvoices(req *lndhubrpc.SubsribeInvoicesRequest, srv lndhubrpc.InvoiceSubscription_SubsribeInvoicesServer) error {
|
||||
incomingInvoices := make(chan models.Invoice)
|
||||
_, err := s.svc.InvoicePubSub.Subscribe(common.InvoiceTypeIncoming, incomingInvoices)
|
||||
incomingInvoices, _, err := s.svc.InvoicePubSub.Subscribe(common.InvoiceTypeIncoming)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user