From fa2b0bd67cebf8eb40404ba135851ca2bf45d306 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 20 Aug 2025 14:02:31 +0200 Subject: [PATCH] :sparkles: 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. --- backend/src/app/binfile/common.clj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/app/binfile/common.clj b/backend/src/app/binfile/common.clj index 4f01cfe53b..380ea34306 100644 --- a/backend/src/app/binfile/common.clj +++ b/backend/src/app/binfile/common.clj @@ -612,5 +612,9 @@ "A helper for preload file libraries" [{:keys [::db/conn] :as cfg} 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)))