Hello. I am trying to use clj-duration
in my config.edn, that means using a tag #unit/duration
in the EDN. Of course reading config throws an error:
Execution error at integrant.core/read-string (core.cljc:155).
No reader function for tag unit/duration
how do I resolve this? (if at all possible)
nvm found out where to put extra readers
Heh. I was just typing a reply in a scratch file before I saw that you’ve already found it. I’ll add the answer here anyway for others.
duct/read-config
has an optional readers argument which allows you to supply custom readers.
(def my-readers {'uri #(URI. %)
'duration my-duration-function}
;; ...
(duct/read-config (io/resource "blah/blah/config.edn")) my-readers)
You’ll need modify your calls to read-config
wherever it is used, which would typically be within main.clj
and dev.clj
in a vanilla Duct app.