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.
(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).
(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.
Internal key used to store the last updated timestamp for Settings.
Internal key used to store the last updated timestamp for Settings.
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close