Skip to content

Commit

Permalink
Pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaspazza committed Jan 13, 2024
1 parent 01612a0 commit 3b62fd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/cljc/automaton_core/configuration.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
(defn start-conf
[]
(try (println "Starting configuration component")
(let [conf (core-conf-files/->SimpleConf)
(let [conf (core-conf-files/->FilesConf)
env-conf (core-conf-env/->EnvConf)]
(println "Configuration component is started")
[conf env-conf])
Expand All @@ -39,9 +39,7 @@
([key-path default-value]
(let [value (or (core-conf-prot/read-conf-param (first @conf-state) key-path)
(core-conf-prot/read-conf-param (second @conf-state) key-path))]
(when (nil? value)
(println "Value for " key-path " is not set, use default value")
default-value)))
(when (nil? value) (println "Value for " key-path " is not set, use default value") default-value)))
([key-path] (read-param key-path nil)))


3 changes: 1 addition & 2 deletions src/cljc/automaton_core/configuration/files.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@

(def ^{:doc "A map of configuration variables."} conf (memoize read-config))


(defrecord SimpleConf []
(defrecord FilesConf []
core-conf-prot/Conf
(read-conf-param [_this key-path] (get-in (conf) key-path))
(config [_this] (conf)))

0 comments on commit 3b62fd3

Please sign in to comment.