From aaced50b765c2e544bb582bff51759c3edd58c94 Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 2 Mar 2014 14:58:22 -0500 Subject: [PATCH] add option to skip file modification date checks if it is cached already --- src/clj_jtwig/core.clj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/clj_jtwig/core.clj b/src/clj_jtwig/core.clj index 8b68510..796f279 100644 --- a/src/clj_jtwig/core.clj +++ b/src/clj_jtwig/core.clj @@ -10,7 +10,8 @@ (java.io File FileNotFoundException ByteArrayOutputStream))) ; global options -(defonce options (atom {:cache-compiled-templates true})) +(defonce options (atom {:cache-compiled-templates true + :skip-file-modification-check false})) (declare flush-template-cache!) @@ -72,7 +73,8 @@ new-compiled-template)) cached (get @compiled-templates filepath)] (if (and cached - (not (newer? file (:last-modified cached)))) + (or (:skip-file-modification-check @options) + (not (newer? file (:last-modified cached))))) (:template cached) (cache-and-return!))))