diff --git a/backend/src/app/binfile/v1.clj b/backend/src/app/binfile/v1.clj index d2b7cdf7f..5bad01f6d 100644 --- a/backend/src/app/binfile/v1.clj +++ b/backend/src/app/binfile/v1.clj @@ -468,7 +468,7 @@ (defn- read-import-v1 [{:keys [::db/conn ::project-id ::profile-id ::input] :as cfg}] - (db/exec-one! conn ["SET idle_in_transaction_session_timeout = 0"]) + (db/exec-one! conn ["SET LOCAL idle_in_transaction_session_timeout = 0"]) (db/exec-one! conn ["SET CONSTRAINTS ALL DEFERRED"]) (pu/with-open [input (zstd-input-stream input) diff --git a/backend/src/app/rpc/commands/binfile.clj b/backend/src/app/rpc/commands/binfile.clj index 60148eb7e..d6759eb42 100644 --- a/backend/src/app/rpc/commands/binfile.clj +++ b/backend/src/app/rpc/commands/binfile.clj @@ -65,18 +65,16 @@ ;; --- Command: import-binfile (defn- import-binfile - [{:keys [::wrk/executor ::bf.v1/project-id] :as cfg} input] - (db/tx-run! cfg - (fn [{:keys [::db/conn] :as cfg}] - ;; NOTE: the importation process performs some operations that - ;; are not very friendly with virtual threads, and for avoid - ;; unexpected blocking of other concurrent operations we - ;; dispatch that operation to a dedicated executor. - (let [result (px/invoke! executor (partial bf.v1/import-files! cfg input))] - (db/update! conn :project - {:modified-at (dt/now)} - {:id project-id}) - result)))) + [{:keys [::wrk/executor ::bf.v1/project-id ::db/pool] :as cfg} input] + ;; NOTE: the importation process performs some operations that + ;; are not very friendly with virtual threads, and for avoid + ;; unexpected blocking of other concurrent operations we + ;; dispatch that operation to a dedicated executor. + (let [result (px/invoke! executor (partial bf.v1/import-files! cfg input))] + (db/update! pool :project + {:modified-at (dt/now)} + {:id project-id}) + result)) (def ^:private schema:import-binfile