Don't migrate libraries on accessing them on file data migrations

We don't migrate the libraries for avoid cascade migration; it is not ideal
but it reduces the total of the required memory needed for process a single
file migration that requires libraries to be loaded.
This commit is contained in:
Andrey Antukh
2025-08-20 14:02:31 +02:00
parent 9563d1b1f6
commit fa2b0bd67c

View File

@@ -612,5 +612,9 @@
"A helper for preload file libraries" "A helper for preload file libraries"
[{:keys [::db/conn] :as cfg} file] [{:keys [::db/conn] :as cfg} file]
(->> (get-file-libraries conn (:id file)) (->> (get-file-libraries conn (:id file))
(into [file] (map #(get-file cfg (:id %)))) ;; WARNING: we don't migrate the libraries for avoid cascade
;; migration; it is not ideal but it reduces the total of the
;; required memory needed for process a single file migration
;; that requires libraries to be loaded.
(into [file] (map #(get-file cfg (:id %) :migrate? false)))
(d/index-by :id))) (d/index-by :id)))