mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-02 02:10:45 +01:00
update cassandra connections
update cassandra connections
This commit is contained in:
1 parent
dcaf1796fe
commit
5385bf9555
1 file changed
+6
-1
@@ -32,7 +32,12 @@ type CassandraStore struct {
|
||||
|
||||
func NewCassandraStore(keyspace string, hosts ...string) (c *CassandraStore, err error) {
|
||||
c = &CassandraStore{}
|
||||
c.cluster = gocql.NewCluster(hosts...)
|
||||
s := strings.Split(hosts, ",")
|
||||
if len(s) == 1 {
|
||||
c.cluster = gocql.NewCluster(hosts...)
|
||||
} else if len(s) > 1 {
|
||||
c.cluster = gocql.NewCluster(s[0], s[1])
|
||||
}
|
||||
c.cluster.Keyspace = keyspace
|
||||
c.cluster.Consistency = gocql.Quorum
|
||||
c.session, err = c.cluster.CreateSession()
|
||||
|
||||
Reference in new issue
Block a user