Fix leaking relay connections
This commit is contained in:
parent
6ac675429c
commit
ee1574cf45
|
@ -67,8 +67,9 @@ export async function validate ({ nwcUrl }, { logger }) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
// For some reason, websocket is already in CLOSING or CLOSED state.
|
// For some reason, this throws 'WebSocket is already in CLOSING or CLOSED state'
|
||||||
// relay?.close()
|
// even though relay connection is still open here
|
||||||
|
relay?.close()?.catch()
|
||||||
if (relay) logger.info(`closed connection to ${relayUrl}`)
|
if (relay) logger.info(`closed connection to ${relayUrl}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,8 +127,9 @@ export async function sendPayment (bolt11, { nwcUrl }, { logger }) {
|
||||||
})
|
})
|
||||||
return ret
|
return ret
|
||||||
} finally {
|
} finally {
|
||||||
// For some reason, websocket is already in CLOSING or CLOSED state.
|
// For some reason, this throws 'WebSocket is already in CLOSING or CLOSED state'
|
||||||
// relay?.close()
|
// even though relay connection is still open here
|
||||||
|
relay?.close()?.catch()
|
||||||
if (relay) logger.info(`closed connection to ${relayUrl}`)
|
if (relay) logger.info(`closed connection to ${relayUrl}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue