mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
Allow multiple etcd hosts to be specified in db.etcd.host.
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -138,7 +139,7 @@ func NewEtcdClient(ctx context.Context, cfg Config) (*clientv3.Client,
|
|||||||
context.Context, func(), error) {
|
context.Context, func(), error) {
|
||||||
|
|
||||||
clientCfg := clientv3.Config{
|
clientCfg := clientv3.Config{
|
||||||
Endpoints: []string{cfg.Host},
|
Endpoints: strings.Split(cfg.Host, ","),
|
||||||
DialTimeout: etcdConnectionTimeout,
|
DialTimeout: etcdConnectionTimeout,
|
||||||
Username: cfg.User,
|
Username: cfg.User,
|
||||||
Password: cfg.Pass,
|
Password: cfg.Pass,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package etcd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ func NewEtcdTestFixture(t *testing.T) *EtcdTestFixture {
|
|||||||
t.Cleanup(etcdCleanup)
|
t.Cleanup(etcdCleanup)
|
||||||
|
|
||||||
cli, err := clientv3.New(clientv3.Config{
|
cli, err := clientv3.New(clientv3.Config{
|
||||||
Endpoints: []string{config.Host},
|
Endpoints: strings.Split(config.Host, ","),
|
||||||
Username: config.User,
|
Username: config.User,
|
||||||
Password: config.Pass,
|
Password: config.Pass,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user