🐛 Fix file-xlog-gc task.

And decrease the execution interval of the task to every 2 hours.
This commit is contained in:
Andrey Antukh 2021-01-22 17:53:34 +01:00 committed by Alonso Torres
parent 5c1290d5b3
commit 1b70283c3a
2 changed files with 5 additions and 6 deletions

View file

@ -36,8 +36,8 @@
(def ^:private
sql:delete-files-xlog
"delete from task_completed
where scheduled_at < now() - ?::interval")
"delete from file_change
where created_at < now() - ?::interval")
(defn- handler
[{:keys [pool max-age]} _]
@ -45,5 +45,5 @@
(let [interval (db/interval max-age)
result (db/exec-one! conn [sql:delete-files-xlog interval])
result (:next.jdbc/update-count result)]
(log/infof "removed %s rows from file_changes table" result)
(log/infof "removed %s rows from file_change table" result)
nil)))