From 2e4a5aee61b572124545196131f587540fed0b20 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 4 Dec 2023 13:18:43 +0100 Subject: [PATCH] :fire: Remove unnecesary call to px/wrap-bindings --- backend/src/app/features/components_v2.clj | 10 ++++------ backend/src/app/rpc/climit.clj | 4 +--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/backend/src/app/features/components_v2.clj b/backend/src/app/features/components_v2.clj index b1699f9ab..cadac894f 100644 --- a/backend/src/app/features/components_v2.clj +++ b/backend/src/app/features/components_v2.clj @@ -47,7 +47,8 @@ [cuerdas.core :as str] [datoteka.io :as io] [promesa.exec :as px] - [promesa.exec.semaphore :as ps])) + [promesa.exec.semaphore :as ps] + [promesa.util :as pu])) (def ^:dynamic *system* nil) (def ^:dynamic *stats* nil) @@ -698,10 +699,7 @@ (l/trc :hint "graphic processed" :file-id (str (:id fdata)) :media-id (str (:id mobj)) - :elapsed (dt/format-duration (tp1))))))) - - process (px/wrap-bindings process)] - + :elapsed (dt/format-duration (tp1)))))))] (try (->> (d/zip media-group grid) (map (fn [[mobj position]] @@ -717,7 +715,7 @@ fdata)) fdata)) (finally - (.close ^java.lang.AutoCloseable executor))))) + (pu/close! executor))))) (defn- migrate-graphics [fdata] diff --git a/backend/src/app/rpc/climit.clj b/backend/src/app/rpc/climit.clj index dd366fea9..d6e4ccb51 100644 --- a/backend/src/app/rpc/climit.clj +++ b/backend/src/app/rpc/climit.clj @@ -177,9 +177,7 @@ (f))) ([{:keys [::id ::cache ::mtx/metrics]} f executor] - (let [f (fn [] - (let [f (px/wrap-bindings f)] - (p/await! (px/submit! executor f))))] + (let [f #(p/await! (px/submit! executor f))] (if (and cache id) (invoke! cache metrics id nil f) (f)))))