Skip to content

Commit

Permalink
fix(go): removing shared reference of HostSelectionPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhe4rt committed May 29, 2024
1 parent 5bb30f4 commit 8f8329d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/config/gocql.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ var config = struct {
func init() {
config.DB = *gocql.NewCluster()

config.DB.Consistency = gocql.LocalOne
config.DB.PoolConfig.HostSelectionPolicy = gocql.TokenAwareHostPolicy(gocql.RoundRobinHostPolicy())
config.DB.Consistency = gocql.LocalQuorum

pflag.StringArrayVar(&config.DB.Hosts, "hosts", []string{"127.0.0.1"}, "cluster nodes address list")
pflag.DurationVar(&config.DB.Timeout, "timeout", 60*time.Second, "connection timeout")
Expand All @@ -46,5 +45,6 @@ func Session() (*gocql.Session, error) {
func Keyspace() (gocqlx.Session, error) {
cfg := Config()
cfg.Keyspace = db.KeySpace
cfg.PoolConfig.HostSelectionPolicy = gocql.TokenAwareHostPolicy(gocql.RoundRobinHostPolicy())
return gocqlx.WrapSession(gocql.NewSession(cfg))
}

0 comments on commit 8f8329d

Please sign in to comment.