mirror of
https://github.com/penpot/penpot.git
synced 2025-02-25 00:06:09 -05:00
🐛 Fix file-xlog-gc task.
And decrease the execution interval of the task to every 2 hours.
This commit is contained in:
parent
5c1290d5b3
commit
1b70283c3a
2 changed files with 5 additions and 6 deletions
|
@ -165,7 +165,7 @@
|
|||
:fn (ig/ref :app.tasks.file-media-gc/handler)}
|
||||
|
||||
{:id "file-xlog-gc"
|
||||
:cron #app/cron "0 0 0 */1 * ?" ;; daily
|
||||
:cron #app/cron "0 0 */2 * * ?" ;; every 2 hours
|
||||
:fn (ig/ref :app.tasks.file-xlog-gc/handler)}
|
||||
|
||||
{:id "storage-gc"
|
||||
|
@ -229,7 +229,7 @@
|
|||
|
||||
:app.tasks.file-xlog-gc/handler
|
||||
{:pool (ig/ref :app.db/pool)
|
||||
:max-age (dt/duration {:hours 12})
|
||||
:max-age (dt/duration {:hours 6})
|
||||
:metrics (ig/ref :app.metrics/metrics)}
|
||||
|
||||
:app.tasks.telemetry/handler
|
||||
|
@ -275,7 +275,6 @@
|
|||
:handler (ig/ref :app.telemetry/handler)
|
||||
:name "telemetry"}})))
|
||||
|
||||
|
||||
(defmethod ig/init-key :default [_ data] data)
|
||||
(defmethod ig/prep-key :default [_ data] (d/without-nils data))
|
||||
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Add table
Reference in a new issue