                          default-cassandra-options
                          (:cassandra-options options {}))
         _ (log/info "Cassandra options: " c-options)
-        session (-> (alia/cluster c-options)
-                    (alia/connect keyspace))
+        session (alia/connect (alia/cluster c-options) keyspace)
         fetch-pcqls (prepare-cqls fetch-cqls session)
         chan-size (:cassandra-channel-size options default-cassandra-channel-size)
         batch-size (:cassandra-batch-size options default-cassandra-batch-size)

         :errors @stats-errors})
      (shutdown [this]
        (log/info "Shutting down the metric store...")
        (swap! batch #(if (> (count %) 0)
                        (do (async/>!! channel {:values %}) [])
                        %))
        (async/close! channel)
        (while (and (> @stats-processed 0) (not @delete-processed?))
          (Thread/sleep 100))
        (.close session)
        (log/info "The metric store has been down")))))

                                          stats-errors))))))
                      (catch Exception e
                        (log-error e rollup period path stats-errors))))
                  (when-not @data-processed?
                    (swap! data-processed? (fn [_] true))))))
    ch-in))

