mirror of
https://github.com/penpot/penpot.git
synced 2026-11-06 10:00:38 +00:00
♻️ Bind the snapshot loader through the fdata helper
`reduce-snapshots` hand-rolled the same `binding` that `fdata/with-pointers` builds (it also loaded the function's own pointer loader before entering the reduction). Use the macro so the rule holds there too and the namespace no longer needs `app.util.pointer-map`; the loader is identical (same cfg and file-id) and snapshot walking behaves the same. AI-assisted-by: deepseek-v4.1-flash
This commit is contained in:
parent
b3f9ed6289
commit
861634b986
@ -22,7 +22,6 @@
|
||||
[app.jobs :as jobs]
|
||||
[app.storage :as sto]
|
||||
[app.util.blob :as blob]
|
||||
[app.util.pointer-map :as pmap]
|
||||
[cuerdas.core :as str]))
|
||||
|
||||
(def sql:snapshots
|
||||
@ -455,12 +454,11 @@
|
||||
pointer ids never trigger a load."
|
||||
[cfg file-id xform f init]
|
||||
(let [conn (db/get-connection cfg)
|
||||
load (partial fdata/load-pointer cfg file-id)
|
||||
xform (comp
|
||||
(map (partial fdata/resolve-file-data cfg))
|
||||
(map (partial fdata/decode-file-data cfg))
|
||||
xform)]
|
||||
|
||||
(binding [pmap/*load-fn* load]
|
||||
(fdata/with-pointers cfg file-id
|
||||
(->> (db/plan conn [sql:get-snapshots file-id] {:fetch-size 1})
|
||||
(transduce xform f init)))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user