mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
kvdb: set postgres max_connections on the started instance
This commit is contained in:
parent
524fa66abf
commit
25af657ad5
1 changed files with 10 additions and 2 deletions
|
@ -27,7 +27,7 @@ func getTestDsn(dbName string) string {
|
||||||
|
|
||||||
var testPostgres *embeddedpostgres.EmbeddedPostgres
|
var testPostgres *embeddedpostgres.EmbeddedPostgres
|
||||||
|
|
||||||
const testMaxConnections = 50
|
const testMaxConnections = 200
|
||||||
|
|
||||||
// StartEmbeddedPostgres starts an embedded postgres instance. This only needs
|
// StartEmbeddedPostgres starts an embedded postgres instance. This only needs
|
||||||
// to be done once, because NewFixture will create random new databases on every
|
// to be done once, because NewFixture will create random new databases on every
|
||||||
|
@ -37,7 +37,15 @@ func StartEmbeddedPostgres() (func() error, error) {
|
||||||
|
|
||||||
postgres := embeddedpostgres.NewDatabase(
|
postgres := embeddedpostgres.NewDatabase(
|
||||||
embeddedpostgres.DefaultConfig().
|
embeddedpostgres.DefaultConfig().
|
||||||
Port(9876))
|
Port(9876).
|
||||||
|
StartParameters(
|
||||||
|
map[string]string{
|
||||||
|
"max_connections": fmt.Sprintf(
|
||||||
|
"%d", testMaxConnections,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
err := postgres.Start()
|
err := postgres.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue