(check {:keys [attempts exception-field-key] :as throttler} keyy)Throttle an API call based on values of KEYY. Each call to this function will record KEYY to THROTTLER's internal list; if the number of entires containing KEYY exceed THROTTLER's thresholds, throw an exception.
(defendpoint POST [:as {{:keys [email]} :body}] (throttle/check email-throttler email) ...)
Throttle an API call based on values of KEYY. Each call to this function will record KEYY to THROTTLER's internal list;
if the number of entires containing KEYY exceed THROTTLER's thresholds, throw an exception.
(defendpoint POST [:as {{:keys [email]} :body}]
(throttle/check email-throttler email)
...)(make-throttler exception-field-key & {:as kwargs})Create a new Throttler.
(require '[metabase.api.common.throttle :as throttle]) (def email-throttler (throttle/make-throttler :email, :attempts-threshold 10))
Create a new `Throttler`. (require '[metabase.api.common.throttle :as throttle]) (def email-throttler (throttle/make-throttler :email, :attempts-threshold 10))
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |