Move caching in to main action

This commit is contained in:
2023-11-18 12:06:39 +11:00
parent 0442e7cd6c
commit 07b0b92da6
2 changed files with 5 additions and 49 deletions

View File

@@ -4,10 +4,10 @@ module Adamantium
module Actions
module RecentlyPlayed
class Index < Action
include Deps["views.recently_played.index", "view_cache.cacher"]
include Deps["views.recently_played.index"]
def handle(req, res)
res.body = cacher.call(key: "recently_played", content: index.call.to_str, expiry: TimeMath.min.advance(Time.now, +10))
res.body = cache(key: "recently_played", content: index.call.to_str)
end
end
end