mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
Merge remote-tracking branch 'origin/main' into develop
This commit is contained in:
commit
d7eec3b92b
4 changed files with 13 additions and 28 deletions
|
@ -230,30 +230,21 @@
|
|||
|
||||
:app.tasks.tasks-gc/handler
|
||||
{:pool (ig/ref :app.db/pool)
|
||||
:max-age cf/deletion-delay
|
||||
:metrics (ig/ref :app.metrics/metrics)}
|
||||
:max-age cf/deletion-delay}
|
||||
|
||||
:app.tasks.delete-object/handler
|
||||
{:pool (ig/ref :app.db/pool)
|
||||
:metrics (ig/ref :app.metrics/metrics)}
|
||||
|
||||
:app.tasks.delete-storage-object/handler
|
||||
{:pool (ig/ref :app.db/pool)
|
||||
:storage (ig/ref :app.storage/storage)
|
||||
:metrics (ig/ref :app.metrics/metrics)}
|
||||
:storage (ig/ref :app.storage/storage)}
|
||||
|
||||
:app.tasks.delete-profile/handler
|
||||
{:pool (ig/ref :app.db/pool)
|
||||
:metrics (ig/ref :app.metrics/metrics)}
|
||||
{:pool (ig/ref :app.db/pool)}
|
||||
|
||||
:app.tasks.file-media-gc/handler
|
||||
{:pool (ig/ref :app.db/pool)
|
||||
:metrics (ig/ref :app.metrics/metrics)
|
||||
:max-age cf/deletion-delay}
|
||||
|
||||
:app.tasks.file-xlog-gc/handler
|
||||
{:pool (ig/ref :app.db/pool)
|
||||
:metrics (ig/ref :app.metrics/metrics)
|
||||
:max-age (dt/duration {:hours 48})}
|
||||
|
||||
:app.tasks.telemetry/handler
|
||||
|
|
|
@ -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}]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -98,11 +98,11 @@
|
|||
;; Terminate the loop if close channel is closed or
|
||||
;; event-loop-fn returns nil.
|
||||
(or (= port close-ch) (nil? val))
|
||||
(l/debug :msg "stop condition found")
|
||||
(l/debug :hint "stop condition found")
|
||||
|
||||
(db/pool-closed? pool)
|
||||
(do
|
||||
(l/debug :msg "eventloop aborted because pool is closed")
|
||||
(l/debug :hint "eventloop aborted because pool is closed")
|
||||
(a/close! close-ch))
|
||||
|
||||
(and (instance? java.sql.SQLException val)
|
||||
|
@ -115,7 +115,7 @@
|
|||
(and (instance? java.sql.SQLException val)
|
||||
(= "40001" (.getSQLState ^java.sql.SQLException val)))
|
||||
(do
|
||||
(l/debug :msg "serialization failure (retrying in some instants)")
|
||||
(l/debug :hint "serialization failure (retrying in some instants)")
|
||||
(a/<! (a/timeout poll-ms))
|
||||
(recur))
|
||||
|
||||
|
@ -243,7 +243,7 @@
|
|||
(let [task-fn (get tasks name)]
|
||||
(if task-fn
|
||||
(task-fn item)
|
||||
(l/warn :msg "no task handler found"
|
||||
(l/warn :hint "no task handler found"
|
||||
:name (d/name name)))
|
||||
{:status :completed :task item}))
|
||||
|
||||
|
@ -281,19 +281,13 @@
|
|||
[{:keys [tasks]} item]
|
||||
(let [name (d/name (:name item))]
|
||||
(try
|
||||
(l/debug :action "start task"
|
||||
:name name
|
||||
(l/debug :action "execute task"
|
||||
:id (:id item)
|
||||
:name name
|
||||
:retry (:retry-num item))
|
||||
|
||||
(handle-task tasks item)
|
||||
(catch Exception e
|
||||
(handle-exception e item))
|
||||
(finally
|
||||
(l/debug :action "end task"
|
||||
:name name
|
||||
:id (:id item)
|
||||
:retry (:retry-num item))))))
|
||||
(handle-exception e item)))))
|
||||
|
||||
(def sql:select-next-tasks
|
||||
"select * from task as t
|
||||
|
|
Loading…
Add table
Reference in a new issue