Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Cache Store OpenAPI description only for 5min (#63168)

Dennis Schridde7e0f54bb73b2
diff --git a/enterprise/backend/src/metabase_enterprise/harbormaster/client.clj b/enterprise/backend/src/metabase_enterprise/harbormaster/client.clj
index 5ef30c3507b..5816aa0a3c4 100644
--- a/enterprise/backend/src/metabase_enterprise/harbormaster/client.clj
+++ b/enterprise/backend/src/metabase_enterprise/harbormaster/client.clj
@@ -2,6 +2,7 @@
"API client for interfacing with Harbormaster on store-api-url."
(:require
[clj-http.client :as http]
+ [clojure.core.memoize :as memoize]
[clojure.string :as str]
[martian.clj-http :as martian-http]
[martian.core :as martian]
@@ -135,7 +136,8 @@
{:headers {"Authorization" (str "Bearer " api-key)}}))
(def ^:private create-client-memo
- (memoize create-client))
+ (memoize/ttl create-client
+ :ttl/threshold (m.util/minutes->ms 5)))
(defn- client []
(let [store-api-url (store-api/store-api-url)