Remove useless variable from cockroach store (#1400)

This commit is contained in:
Jake Sanders
2020-03-24 15:37:30 +00:00
committed by GitHub
parent 914340585c
commit eb4d2ae6aa
2 changed files with 4 additions and 5 deletions

View File

@@ -296,9 +296,8 @@ func (s *sqlStore) initDB() error {
}
func (s *sqlStore) configure() error {
nodes := s.options.Nodes
if len(nodes) == 0 {
nodes = []string{"localhost:26257"}
if len(s.options.Nodes) == 0 {
s.options.Nodes = []string{"localhost:26257"}
}
namespace := s.options.Namespace
@@ -318,7 +317,7 @@ func (s *sqlStore) configure() error {
}
namespace = reg.ReplaceAllString(namespace, "_")
source := nodes[0]
source := s.options.Nodes[0]
// check if it is a standard connection string eg: host=%s port=%d user=%s password=%s dbname=%s sslmode=disable
// if err is nil which means it would be a URL like postgre://xxxx?yy=zz
_, err = url.Parse(source)