Closed kiwiidb closed 1 year ago
@kiwiidb Should we also add an index for the invoice subscription query, too? It's only a matter of time until this query takes longer than the timeout.
explain analyze select * from public.invoices where invoices.settled_at IS NULL AND invoices.add_index IS NOT NULL AND invoices.expires_at >= now() order by invoices.id ASC
leads to some really awful query plan as there are no indexes to be used currently.
I think we would need to add a combined column index on the used columns to speed this up.
@reneaaron of course :) indexes need to be pimped
Fixes #312 , fixes #313 This PR changes the behaviour of the invoice subscription routine in case of an error:
If the
Recv()
call fails (probably because LND is down), then we will also force LNDhub to restart, so it can try to reconnect to LND.Other than that