0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-06 12:01:19 -05:00

🐛 Launch offload only if file-gc has processed the file

This commit is contained in:
Andrey Antukh 2024-08-12 11:03:38 +02:00
parent 280252d40e
commit ab461ba560

View file

@ -301,16 +301,15 @@
(try
(db/tx-run! cfg (fn [{:keys [::db/conn] :as cfg}]
(let [cfg (update cfg ::sto/storage sto/configure conn)
res (process-file! cfg)]
(when (contains? cf/flags :tiered-file-data-storage)
(let [cfg (update cfg ::sto/storage sto/configure conn)
processed? (process-file! cfg)]
(when (and processed? (contains? cf/flags :tiered-file-data-storage))
(wrk/submit! (-> cfg
(assoc ::wrk/task :offload-file-data)
(assoc ::wrk/params props)
(assoc ::wrk/priority 10)
(assoc ::wrk/delay 1000))))
res)))
processed?)))
(catch Throwable cause
(l/err :hint "error on cleaning file"