return new value that was added to the cache

i thought swap! was supposed to return this value by itself?
This commit is contained in:
Gered 2014-03-29 09:27:14 -04:00
parent 5fc46d12e9
commit e50fb349c3

View file

@ -15,8 +15,10 @@
(let [cached-post (get @post-md-cache _id)]
(if (or (not cached-post)
(after? created_at (:created_at cached-post)))
(swap! post-md-cache assoc _id {:created_at created_at
:html_body (md->html body)})
(do
(swap! post-md-cache assoc _id {:created_at created_at
:html_body (md->html body)})
(get @post-md-cache _id))
cached-post)))
(defn- merge-cached-post-md! [post]