  (fn []
    (doseq [path @pkeys]
      (fn-store tenant period rollup time path (fn-agg (fn-data path)) ttl)
-     (swap! tkeys (fn [tkeys time] (dissoc tkeys time)) time)
+     (swap! tkeys (fn [tkeys] (dissoc tkeys time)))
      (when (empty? tkeys)
        (swap! mkeys (fn [mkeys mkey] (dissoc mkeys mkey))
               (construct-mkey tenant period rollup))))))

  [mkeys tenant period rollup]
  (let [mkey (construct-mkey tenant period rollup)]
    (swap! mkeys
           (fn [mkeys mkey]
             (if (contains? mkeys mkey)
               mkeys
               (assoc mkeys mkey (atom {}))))
           mkey)
    (get @mkeys mkey)))

(defn create-flusher

                                           rollup time ttl fn-data fn-agg
                                           fn-store)]
               (swap! pkeys
                      (fn [pkeys]
                        (with-meta pkeys {:flusher flusher})))
               (assoc! tkeys time pkeys)
               (run-delayer! rollup flusher))))
         time)
