From 97d2af048c2fc582171f230f81b9e793f08f2797 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 11 May 2023 07:57:31 +0200 Subject: [PATCH] :bug: Fix srepl get-file helper (add support for pointer map) --- backend/src/app/srepl/helpers.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/src/app/srepl/helpers.clj b/backend/src/app/srepl/helpers.clj index 4f745b68d8..ca09826766 100644 --- a/backend/src/app/srepl/helpers.clj +++ b/backend/src/app/srepl/helpers.clj @@ -58,10 +58,12 @@ (defn get-file "Get the migrated data of one file." [system id] - (-> (:app.db/pool system) - (db/get-by-id :file id) - (update :data blob/decode) - (update :data pmg/migrate-data))) + (db/with-atomic [conn (:app.db/pool system)] + (binding [pmap/*load-fn* (partial files/load-pointer conn id)] + (-> (db/get-by-id conn :file id) + (update :data blob/decode) + (update :data pmg/migrate-data) + (files/process-pointers deref))))) (defn update-file! "Apply a function to the data of one file. Optionally save the changes or not.