♻️ Minor task naming and directory structure refactor.

This commit is contained in:
Andrey Antukh 2020-12-11 15:43:13 +01:00 committed by Alonso Torres
parent 4849904b0b
commit f84d0f34e6
5 changed files with 93 additions and 80 deletions

View file

@ -15,6 +15,7 @@
[app.common.pages.migrations :as pmg]
[app.config :as cfg]
[app.db :as db]
[app.metrics :as mtx]
[app.tasks :as tasks]
[app.util.blob :as blob]
[app.util.time :as dt]
@ -94,10 +95,16 @@
(defn handler
[_task]
(log/debug "running 'file-media-gc' task.")
(db/with-atomic [conn db/pool]
(loop []
(let [files (retrieve-candidates conn)]
(when (seq files)
(run! (partial process-file conn) files)
(recur))))))
(mtx/instrument-with-summary!
{:var #'handler
:id "tasks__file_media_gc"
:help "Timing of task: file_media_gc"})