Skip to content

Commit

Permalink
gocql: DisableInitialHostLookup as backend configuration parameter (#…
Browse files Browse the repository at this point in the history
…9733)

* setting option for gocql: DisableInitialHostLookup thru backend config section

* adding newline between 'if' blocks to keep code strict

---------

Co-authored-by: Violet Hynes <[email protected]>
  • Loading branch information
kilocaleb and VioletHynes authored Jun 3, 2024
1 parent 1c4aa53 commit f11f464
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions physical/cassandra/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ func NewCassandraBackend(conf map[string]string, logger log.Logger) (physical.Ba
cluster.Timeout = time.Duration(connectionTimeout) * time.Second
}

if disableInitialHostLookupStr, ok := conf["disable_host_initial_lookup"]; ok {
disableInitialHostLookup, err := strconv.ParseBool(disableInitialHostLookupStr)
if err != nil {
return nil, fmt.Errorf("'disable_host_initial_lookup' must be a bool")
}
cluster.DisableInitialHostLookup = disableInitialHostLookup
}

if err := setupCassandraTLS(conf, cluster); err != nil {
return nil, err
}
Expand Down

0 comments on commit f11f464

Please sign in to comment.