       (catch Exception e
         (info e "Cache flushing exception")))))
 
-(defn run-delayer!
+(defn- run-delayer!
   [rollup fn-flusher]
   (let [delayer (future
                   (Thread/sleep (to-ms (calc-delay rollup (rand-int 59)))))

                  (fn-flusher))]
    [delayer flusher]))

(defn set-pkeys!
  [mkeys tenant period rollup time ttl fn-get fn-agg fn-store fn-key]
  (let [mkey (construct-mkey tenant period rollup time)]
    (swap! mkeys

                (assoc % mkey pkeys))))
    (get @mkeys mkey)))

(defn- set-keys!
  [mkeys tenant period rollup time path ttl fn-get fn-agg fn-store fn-key]
  (let [pkeys (set-pkeys! mkeys tenant period rollup time ttl fn-get
                          fn-agg fn-store fn-key)]
    (swap! pkeys #(if (contains? % path) % (conj % path)))
    pkeys))

(defn- run-flusher!
  [mkeys]
  (debug "Flushing the cache...")
  (doseq [[mkey pkeys] @mkeys]
