 (defn create-flusher
   [mkeys mkey pkeys tenant period rollup time ttl fn-get fn-agg fn-store fn-key]
   (fn []
-    (doseq [path @pkeys]
-      (fn-store tenant period rollup time path
-                (fn-agg (fn-get
-                         (fn-key tenant period rollup time path)
-                         @pkeys)) ttl))
-    (swap! mkeys #(dissoc % mkey))))
+    (try
+      (doseq [path @pkeys]
+        (fn-store tenant period rollup time path
+                  (fn-agg (fn-get
+                           (fn-key tenant period rollup time path)
+                           @pkeys)) ttl))
+      (swap! mkeys #(dissoc % mkey))
+      (catch Exception e
+        (info e "Cache flushing exception")))))
 
 (defn run-delayer!
   [rollup fn-flusher]

(ns org.spootnik.cyanite.store_cache
  "Caching facility for Cyanite"
  (:require [clojure.string :as str]
            [clojure.core.async :as async :refer [>!]]
            [clojure.tools.logging :refer [error info debug]]
            [org.spootnik.cyanite.store :as store]))


        cache-get (fn [key pkeys] (get @(get-data pkeys) key))
        cache-key (fn [tenant period rollup time path] (hash path))
        schan (store/channel-for store)
        ;;fn-store (partial store-chan schan)
        fn-store (fn [tenant period rollup time path data ttl]
                   (store-chan tenant period rollup time path data ttl schan))
        ]

    (reify
      StoreCache
      (put! [this tenant period rollup time path data ttl]
