mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-01-04 21:45:30 +01:00
Don't defer close when the creation failed
This commit is contained in:
@@ -49,10 +49,10 @@ func (controller *InvoiceStreamController) StreamInvoices(c echo.Context) error
|
||||
invoiceChan := make(chan models.Invoice)
|
||||
ticker := time.NewTicker(30 * time.Second)
|
||||
ws, done, err := createWebsocketUpgrader(c)
|
||||
defer ws.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer ws.Close()
|
||||
//start subscription
|
||||
subId, err := controller.svc.InvoicePubSub.Subscribe(strconv.FormatInt(userId, 10), invoiceChan)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user