Liking cljdoc? Tell your friends :D

metabase.models.setting.cache

Settings cache. Cache is a 1:1 mapping of what's in the DB. Cached lookup time is ~60µs, compared to ~1800µs for DB lookup.

Settings cache. Cache is a 1:1 mapping of what's in the DB. Cached lookup time is ~60µs, compared to ~1800µs for DB
lookup.
raw docstring

cacheclj

(cache)

Fetch the current contents of the Settings cache, a map of key (string) -> value (string).

Fetch the current contents of the Settings cache, a map of key (string) -> value (string).
sourceraw docstring

restore-cache-if-needed!clj

(restore-cache-if-needed!)

Check whether we need to repopulate the cache with fresh values from the DB (because the cache is either empty or known to be out-of-date), and do so if needed. This is intended to be called every time a Setting value is retrieved, so it should be efficient; thus the calculation (should-restore-cache?) is itself TTL-memoized.

Check whether we need to repopulate the cache with fresh values from the DB (because the cache is either empty or
known to be out-of-date), and do so if needed. This is intended to be called every time a Setting value is
retrieved, so it should be efficient; thus the calculation (`should-restore-cache?`) is itself TTL-memoized.
sourceraw docstring

settings-last-updated-keyclj

Internal key used to store the last updated timestamp for Settings.

Internal key used to store the last updated timestamp for Settings.
sourceraw docstring

update-cache!clj

(update-cache! setting-name new-value)

Update the String value of a Setting in the Settings cache.

Update the String value of a Setting in the Settings cache.
sourceraw docstring

update-settings-last-updated!clj

(update-settings-last-updated!)

Update the value of settings-last-updated in the DB; if the row does not exist, insert one.

Update the value of `settings-last-updated` in the DB; if the row does not exist, insert one.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close