fix scale reference
This commit is contained in:
@@ -12,7 +12,6 @@ class PopularSearchService
|
||||
end
|
||||
|
||||
@date = date
|
||||
@scale = "day"
|
||||
end
|
||||
|
||||
def each_search(limit = 100, &block)
|
||||
@@ -26,8 +25,8 @@ class PopularSearchService
|
||||
def fetch_data
|
||||
dates = date.strftime("%Y-%m-%d")
|
||||
|
||||
Cache.get("ps-#{scale}-#{dates}", 1.minute) do
|
||||
url = "#{Danbooru.config.reportbooru_server}/hits/#{scale}?date=#{dates}"
|
||||
Cache.get("ps-day-#{dates}", 1.minute) do
|
||||
url = "#{Danbooru.config.reportbooru_server}/hits/day?date=#{dates}"
|
||||
response = HTTParty.get(url, Danbooru.config.httparty_options.reverse_merge(timeout: 3))
|
||||
if response.success?
|
||||
response = response.body
|
||||
|
||||
@@ -10,7 +10,7 @@ class PostViewCountService
|
||||
end
|
||||
|
||||
def fetch_count(post_id)
|
||||
url = URI.parse("#{Danbooru.config.reportbooru_server}/post_views/#{post_id}?date=#{date}")
|
||||
url = URI.parse("#{Danbooru.config.reportbooru_server}/post_views/#{post_id}")
|
||||
response = HTTParty.get(url, Danbooru.config.httparty_options.reverse_merge(timeout: 6))
|
||||
if response.success?
|
||||
return JSON.parse(response.body)
|
||||
|
||||
Reference in New Issue
Block a user