From 172b70d8a70b1254dde00f24b20bf76d0d046677 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 22 May 2025 09:14:01 +0200 Subject: [PATCH] :arrow_up: Upgrade promesa library to latest version That fixes a workaround introduced in previous commits --- backend/src/app/rpc/climit.clj | 16 +++++++--------- common/deps.edn | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/backend/src/app/rpc/climit.clj b/backend/src/app/rpc/climit.clj index 542988bf55..bb3db5ba58 100644 --- a/backend/src/app/rpc/climit.clj +++ b/backend/src/app/rpc/climit.clj @@ -22,8 +22,7 @@ [datoteka.fs :as fs] [integrant.core :as ig] [promesa.exec :as px] - [promesa.exec.bulkhead :as pbh] - [promesa.protocols :as pt]) + [promesa.exec.bulkhead :as pbh]) (:import clojure.lang.ExceptionInfo java.util.concurrent.atomic.AtomicLong)) @@ -179,13 +178,12 @@ (measure metrics mlabels stats nil) (log "enqueued" req-id stats limit-id limit-label limit-params nil)) - ;; WORKAROUND: this is a temporal change until the bug is fixed in funcool/promesa - @(pt/-submit! limiter (fn [] - (let [elapsed (tpoint) - stats (pbh/get-stats limiter)] - (measure metrics mlabels stats elapsed) - (log "acquired" req-id stats limit-id limit-label limit-params elapsed) - (handler)))) + (px/invoke! limiter (fn [] + (let [elapsed (tpoint) + stats (pbh/get-stats limiter)] + (measure metrics mlabels stats elapsed) + (log "acquired" req-id stats limit-id limit-label limit-params elapsed) + (handler)))) (catch ExceptionInfo cause (let [{:keys [type code]} (ex-data cause)] diff --git a/common/deps.edn b/common/deps.edn index c96648ac39..92a28b6184 100644 --- a/common/deps.edn +++ b/common/deps.edn @@ -30,7 +30,7 @@ funcool/tubax {:mvn/version "2021.05.20-0"} funcool/cuerdas {:mvn/version "2023.11.09-407"} funcool/promesa - {:git/sha "6c14b06d9d64fae6e43c1463ce313f2fdc0d989b" + {:git/sha "f52f58cfacf62f59eab717e2637f37729d0cc383" :git/url "https://github.com/funcool/promesa"} funcool/datoteka