mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-02-09 06:54:24 +01:00
only start listening when it's needed
This commit is contained in:
@@ -69,6 +69,7 @@ func TestCreateUserTestSuite(t *testing.T) {
|
||||
func LndHubTestServiceInit() (*service.LndhubService, error) {
|
||||
// change this if you want to run tests using sqlite
|
||||
// dbUri := "file:data_test.db"
|
||||
//make sure the datbase is empty every time you run the test suite
|
||||
dbUri := "postgresql://user:password@localhost/lndhub?sslmode=disable"
|
||||
c := &service.Config{
|
||||
DatabaseUri: dbUri,
|
||||
@@ -120,7 +121,5 @@ func LndHubTestServiceInit() (*service.LndhubService, error) {
|
||||
logger.Fatalf("Failed to parse node IdentityPubkey: %v", err)
|
||||
}
|
||||
svc.IdentityPubkey = identityPubKey
|
||||
// Subscribe to LND invoice updates in the background
|
||||
go svc.InvoiceUpdateSubscription(context.Background())
|
||||
return svc, nil
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@ func (suite *IncomingPaymentTestSuite) SetupSuite() {
|
||||
if err != nil {
|
||||
log.Fatalf("Error initializing test service: %v", err)
|
||||
}
|
||||
// Subscribe to LND invoice updates in the background
|
||||
go svc.InvoiceUpdateSubscription(context.Background())
|
||||
suite.service = svc
|
||||
e := echo.New()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user