Liking cljdoc? Tell your friends :D

sturdy.throttle.sqlite


admit-sqlclj

(admit-sql org-id rate-key bucket-ms window-start limit)

A single atomic statement that checks the rate limit and UPSERTs if allowed. Returns 1 updated row if admitted, or 0 if rejected by the WHERE clause.

A single atomic statement that checks the rate limit and UPSERTs if allowed.
Returns 1 updated row if admitted, or 0 if rejected by the WHERE clause.
sourceraw docstring

b-optsclj

source

bucket-start-msclj

(bucket-start-ms now-ms)
source

close-limiterclj

(close-limiter limiter)
source

hour-msclj

source

make-quota-limiterclj

(make-quota-limiter
  {:keys [db-name db-dir limit prune-every batch-size profile-key]
   :or {batch-size 500 profile-key :write-intensive prune-every 1000}})

Creates a SQLite-backed quota limiter. Initializes the database and runs migrations. config map requires:

  • :db-dir
  • :db-name
  • :limit (number of requests per hour)
  • :prune-every (approximate number of requests before running a background prune, e.g. 1000)
Creates a SQLite-backed quota limiter.
Initializes the database and runs migrations.
`config` map requires:
- :db-dir
- :db-name
- :limit (number of requests per hour)
- :prune-every (approximate number of requests before running a background prune, e.g. 1000)
sourceraw docstring

minute-msclj

source

now-msclj

(now-ms)
source

oldest-live-bucket-msclj

(oldest-live-bucket-ms now-ms)
source

prune-sqlclj

(prune-sql now-ms)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close