       (when-not disable-progress
        (prog/done))
       (finally
-        (mstore/shutdown mstore)
-        (pstore/shutdown pstore)))))
+        (when mstore
+          (mstore/shutdown mstore))
+        (when pstore
+          (pstore/shutdown pstore))))))
 
 (defn list-paths
   "List paths."

          (let [ttl (- time (- (utils/now) retention))]
            (when (> ttl min-ttl)
              (when run
                (when-not disable-metric-store
                  (mstore/insert mstore tenant rollup period path time
                                 value ttl))
                (when-not @path-stored?
                  (when-not disable-path-store
                    (pstore/insert pstore tenant path))
                  (swap! path-stored? (fn [_] true)))))))))))


        series (:series data)
        path-stored? (atom false)
        run (:run options false)
        min-ttl (:min-ttl options default-min-ttl)]
    (doseq [point series]
      (let [time (first point)
            value (last point)]
