Updated GabTrendsController feed redis key

• Updated:
- GabTrendsController feed redis key
This commit is contained in:
mgabdev 2020-07-06 15:15:28 -05:00
parent ad4c6df155
commit 7087926a9c
1 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ class Api::V1::GabTrendsController < Api::BaseController
def index
type = params[:type]
if type == 'feed'
body = Redis.current.get("gabtrends")
body = Redis.current.get("gabtrends:feed")
if body.nil?
uri = URI("https://trends.gab.com/trend-feed/json")
@ -17,8 +17,8 @@ class Api::V1::GabTrendsController < Api::BaseController
res = Net::HTTP.get_response(uri)
if res.is_a?(Net::HTTPSuccess)
body = res.body
Redis.current.set("gabtrends", res.body)
Redis.current.expire("gabtrends", 1.hour.seconds)
Redis.current.set("gabtrends:feed", res.body)
Redis.current.expire("gabtrends:feed", 1.hour.seconds)
end
end