Add action cache and cache now playing requests
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
require "time_math"
|
||||
|
||||
module Adamantium
|
||||
module Actions
|
||||
module RecentlyPlayed
|
||||
class Index < Action
|
||||
include Deps["views.recently_played.index"]
|
||||
include Deps["views.recently_played.index", "view_cache.cacher"]
|
||||
|
||||
def handle(req, res)
|
||||
res.render index
|
||||
res.body = cacher.call(key: "recently_played", content: index.call.to_str, expiry: TimeMath.min.advance(Time.now, +10))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user