🐛 Fix custom font deletion task.

This commit is contained in:
Andrey Antukh 2021-06-03 12:55:31 +02:00
parent 1b495ebad1
commit bae709df5b
4 changed files with 13 additions and 28 deletions

View file

@ -18,7 +18,7 @@
(declare handle-deletion)
(defmethod ig/pre-init-spec ::handler [_]
(s/keys :req-un [::db/pool]))
(s/keys :req-un [::db/pool ::sto/storage]))
(defmethod ig/init-key ::handler
[_ {:keys [pool] :as cfg}]

View file

@ -23,12 +23,12 @@
(defmethod ig/init-key ::handler
[_ {:keys [pool max-age] :as cfg}]
(fn [_]
(fn [task]
(db/with-atomic [conn pool]
(let [interval (db/interval max-age)
result (db/exec-one! conn [sql:delete-files-xlog interval])
result (:next.jdbc/update-count result)]
(l/debug :action "trim file-change table" :removed result)
(l/debug :removed result :hint "remove old file changes")
result))))
(def ^:private