mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 01:06:11 +02:00
✨ Add the ability to create a file snapshot on repair
This commit is contained in:
parent
c07dbc9843
commit
f9af2a16b9
1 changed files with 5 additions and 2 deletions
|
@ -405,11 +405,11 @@
|
||||||
(d/index-by :id))]
|
(d/index-by :id))]
|
||||||
(cfv/validate-file file libs)))))
|
(cfv/validate-file file libs)))))
|
||||||
|
|
||||||
(defn repair-file*
|
(defn- repair-file*
|
||||||
"Internal helper for validate and repair the file. The operation is
|
"Internal helper for validate and repair the file. The operation is
|
||||||
applied multiple times untile file is fixed or max iteration counter
|
applied multiple times untile file is fixed or max iteration counter
|
||||||
is reached (default 10)"
|
is reached (default 10)"
|
||||||
[system id & {:keys [max-iterations] :or {max-iterations 10}}]
|
[system id & {:keys [max-iterations label] :or {max-iterations 10}}]
|
||||||
(let [id (parse-uuid id)
|
(let [id (parse-uuid id)
|
||||||
|
|
||||||
validate-and-repair
|
validate-and-repair
|
||||||
|
@ -440,6 +440,9 @@
|
||||||
|
|
||||||
(db/tx-run! system
|
(db/tx-run! system
|
||||||
(fn [{:keys [::db/conn] :as system}]
|
(fn [{:keys [::db/conn] :as system}]
|
||||||
|
(when (string? label)
|
||||||
|
(fsnap/take-file-snapshot! system {:file-id id :label label}))
|
||||||
|
|
||||||
(let [file (h/get-file system id)
|
(let [file (h/get-file system id)
|
||||||
libs (->> (files/get-file-libraries conn id)
|
libs (->> (files/get-file-libraries conn id)
|
||||||
(into [file] (map (fn [{:keys [id]}]
|
(into [file] (map (fn [{:keys [id]}]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue