rename some config keys to clarify what they are
This commit is contained in:
@@ -6,7 +6,7 @@ class MissedSearchService
|
||||
|
||||
def fetch_data
|
||||
Cache.get("ms", 1.minute) do
|
||||
url = URI.parse("#{Danbooru.config.report_server}/missed_searches")
|
||||
url = URI.parse("#{Danbooru.config.reportbooru_server}/missed_searches")
|
||||
response = ""
|
||||
Net::HTTP.start(url.host, url.port, :use_ssl => url.is_a?(URI::HTTPS)) do |http|
|
||||
http.read_timeout = 1
|
||||
|
||||
@@ -15,7 +15,7 @@ class PopularSearchService
|
||||
dates = date.strftime("%Y-%m-%d")
|
||||
|
||||
Cache.get("ps-#{scale}-#{dates}", 1.minute) do
|
||||
url = URI.parse("#{Danbooru.config.report_server}/hits/#{scale}?date=#{dates}")
|
||||
url = URI.parse("#{Danbooru.config.reportbooru_server}/hits/#{scale}?date=#{dates}")
|
||||
response = ""
|
||||
Net::HTTP.start(url.host, url.port, :use_ssl => url.is_a?(URI::HTTPS)) do |http|
|
||||
http.read_timeout = 1
|
||||
|
||||
@@ -20,7 +20,7 @@ module Reports
|
||||
|
||||
def generate_sig
|
||||
digest = OpenSSL::Digest.new("sha256")
|
||||
OpenSSL::HMAC.hexdigest(digest, Danbooru.config.shared_remote_key, "#{min_date},#{max_date},#{queries}")
|
||||
OpenSSL::HMAC.hexdigest(digest, Danbooru.config.reportbooru_key, "#{min_date},#{max_date},#{queries}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -24,13 +24,13 @@ module Reports
|
||||
end
|
||||
|
||||
def fetch_similar_user_ids(endpoint = "user_similarity")
|
||||
return NotImplementedError unless Danbooru.config.report_server
|
||||
return NotImplementedError unless Danbooru.config.reportbooru_server
|
||||
|
||||
params = {
|
||||
"key" => Danbooru.config.shared_remote_key,
|
||||
"key" => Danbooru.config.reportbooru_key,
|
||||
"user_id" => user_id
|
||||
}
|
||||
uri = URI.parse("#{Danbooru.config.report_server}/reports/#{endpoint}")
|
||||
uri = URI.parse("#{Danbooru.config.reportbooru_server}/reports/#{endpoint}")
|
||||
uri.query = URI.encode_www_form(params)
|
||||
|
||||
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.is_a?(URI::HTTPS)) do |http|
|
||||
|
||||
Reference in New Issue
Block a user