mirror of
https://github.com/penpot/penpot.git
synced 2025-06-28 19:07:00 +02:00
✨ Add db conn dynamic binding for srepl helpers
This commit is contained in:
parent
7cb2f307d8
commit
2aa2525d0e
2 changed files with 6 additions and 2 deletions
|
@ -42,6 +42,8 @@
|
|||
org.postgresql.util.PGInterval
|
||||
org.postgresql.util.PGobject))
|
||||
|
||||
(def ^:dynamic *conn* nil)
|
||||
|
||||
(declare open)
|
||||
(declare create-pool)
|
||||
|
||||
|
|
|
@ -423,7 +423,8 @@
|
|||
(let [file-id (h/parse-uuid file-id)]
|
||||
(db/tx-run! (assoc main/system ::db/rollback rollback?)
|
||||
(fn [system]
|
||||
(binding [h/*system* system]
|
||||
(binding [h/*system* system
|
||||
db/*conn* (db/get-connection system)]
|
||||
(h/process-file! system file-id update-fn opts))))))
|
||||
|
||||
(defn process-team-files!
|
||||
|
@ -436,7 +437,8 @@
|
|||
(when (string? label)
|
||||
(h/take-team-snapshot! system team-id label))
|
||||
|
||||
(binding [h/*system* system]
|
||||
(binding [h/*system* system
|
||||
db/*conn* (db/get-connection system)]
|
||||
(->> (feat.comp-v2/get-and-lock-team-files conn team-id)
|
||||
(reduce (fn [result file-id]
|
||||
(if (h/process-file! system file-id update-fn opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue