📎 Allow overwrite archive task props.

This commit is contained in:
Andrey Antukh 2021-08-27 09:42:33 +02:00
parent e768600df3
commit c9985121c4
2 changed files with 5 additions and 2 deletions

View file

@ -208,8 +208,11 @@
(defmethod ig/init-key ::archive-task
[_ {:keys [uri enabled] :as cfg}]
(fn [props]
;; NOTE: this let allows overwrite default configured values from
;; the repl, when manually invoking the task.
(let [enabled (or enabled (:enabled props false))
uri (or uri (:uri props))]
uri (or uri (:uri props))
cfg (assoc cfg :uri uri)]
(when (and enabled (not uri))
(ex/raise :type :internal
:code :task-not-configured