lib/superstore/adapters/cassandra_adapter.rb in superstore-1.1.3 vs lib/superstore/adapters/cassandra_adapter.rb in superstore-1.1.4
- old
+ new
@@ -60,10 +60,18 @@
thrift_options)
end
end
def servers
- Array.wrap(config[:servers] || "127.0.0.1:9160")
+ @servers ||= begin
+ if config[:servers].is_a?(String)
+ config[:servers].split(',')
+ elsif config[:servers].is_a?(Array)
+ config[:servers]
+ else
+ "127.0.0.1:9160"
+ end
+ end
end
def execute(statement)
ActiveSupport::Notifications.instrument("cql.cassandra_object", cql: statement) do
connection.execute statement