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 ""
(defproject document-storage ""
:description "FIXME: write description"
:url ""
: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)]
(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)
(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