Use redis as a cache store

This commit is contained in:
2024-03-16 19:00:52 +11:00
parent e385e6782e
commit 546c51ed4f
12 changed files with 82 additions and 27 deletions

View File

@@ -22,8 +22,8 @@ module Adamantium
handle_exception ROM::TupleCountMismatchError => :not_found
handle_exception StandardError => :handle_error
def cache(key:, content_proc:, expiry: TimeMath.min.advance(Time.now, +10))
cacher.call(key: key, content_proc: content_proc, expiry: expiry)
def cache(key:, params: [], content_proc:, expiry: TimeMath.min.advance(Time.now, +10))
cacher.call(key: key, params: params, content_proc: content_proc, expiry: expiry)
end
def not_found(_req, res, _exception)