Commit 77dd2380 authored by Bruno Burke's avatar Bruno Burke 🍔
Browse files

fix caching bug in load-document

parent 1946333a
Pipeline #28549 passed with stages
in 1 minute and 22 seconds
(defproject document-storage "0.1.6.2"
(defproject document-storage "0.1.6.3"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
......
......@@ -98,16 +98,13 @@
(defn load-document [id & {:keys [repository] :or {repository default-repository}}]
(let [cached-repository (cached-repository? repository)]
(or
(when cached-repository
(get-in @cache [repository :documents id]))
(and cached-repository (get-in @cache [repository :documents id]))
(when (valid-id? id repository)
(let [result (read-string (slurp (get-file-path id repository)))]
(if cached-repository
(cache-document repository id result)
result
)
)
))))
))))))
(defn save-document [id document & {:keys [repository] :or {repository default-repository}}]
(let [file-path (get-file-path id repository)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment