Skip to content

Commit 2cb20f2

Browse files
committed
Fix check for globally disabled cache
1 parent cc07b80 commit 2cb20f2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/nextjournal/clerk/eval.clj

+8-7
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,14 @@
268268
(process-cljs parsed-doc)
269269
(let [{:as analyzed-doc :keys [ns]}
270270

271-
(if no-cache
271+
(cond
272+
no-cache
272273
parsed-doc
274+
275+
config/cache-disabled?
276+
(assoc parsed-doc :no-cache true)
277+
278+
:else
273279
(do
274280
(when set-status-fn
275281
(set-status-fn {:progress 0.10 :status "Analyzing…"}))
@@ -286,11 +292,7 @@
286292
(defn eval-doc
287293
"Evaluates the given `doc`."
288294
([doc] (eval-doc {} doc))
289-
([in-memory-cache doc]
290-
(+eval-results in-memory-cache
291-
(cond-> doc
292-
config/cache-disabled?
293-
(assoc :no-cache true)))))
295+
([in-memory-cache doc] (+eval-results in-memory-cache doc)))
294296

295297
(defn eval-file
296298
"Reads given `file` (using `slurp`) and evaluates it."
@@ -313,4 +315,3 @@
313315
#_(eval-string "(+ 39 3)")
314316

315317
#_(nextjournal.clerk/show! "notebooks/hello.md")
316-

0 commit comments

Comments
 (0)