Skip to content

Commit

Permalink
Patroni works with empty conn_str
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Saletnik authored and pashagolub committed Sep 25, 2024
1 parent f1550df commit 72f56b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/sources/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func getEtcdClusterMembers(s Source) ([]PatroniClusterMember, error) {
if err != nil {
return ret, err
}
defer c.Close()

ctx, cancel := context.WithTimeoutCause(context.Background(), 5*time.Second, errors.New("etcd client timeout"))
defer cancel()
Expand Down Expand Up @@ -302,6 +303,7 @@ func ResolveDatabasesFromPatroni(ce Source) ([]*MonitoredDatabase, error) {
logger.Errorf("Could not contact Patroni member [%s:%s]: %v", ce.Name, m.Scope, err)
continue
}
connURL.Scheme = "postgresql"
connURL.Host = host + ":" + port
connURL.Path = "template1"
c, err := db.New(context.TODO(), connURL.String())
Expand Down

0 comments on commit 72f56b8

Please sign in to comment.