From 35ead8df06015cd4101180c81558909de6e17e30 Mon Sep 17 00:00:00 2001 From: Christopher Guess Date: Mon, 3 Jun 2024 15:57:20 -0400 Subject: [PATCH] Update for new Grigori --- app/models/scrape.rb | 7 +++++-- config/application.rb | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/models/scrape.rb b/app/models/scrape.rb index efac0923..a2dc5332 100644 --- a/app/models/scrape.rb +++ b/app/models/scrape.rb @@ -32,15 +32,18 @@ def enqueue # This does it synchronously. If you're calling this you probably mean to call `enqueue` sig { returns(Hash) } def perform - params = { auth_key: Figaro.env.HYPATIA_AUTH_KEY, url: self.url, callback_id: self.id } + params = { url: { auth_key: Figaro.env.HYPATIA_AUTH_KEY, url: self.url, callback_id: self.id } } # Move this to the Scrape model so they're easily resubmittable response = Typhoeus.get( Figaro.env.HYPATIA_SERVER_URL, followlocation: true, - params: params + params: params, + ssl_verifypeer: false, + ssl_verifyhost: 0 ) + json_error_response = JSON.parse(response.body) if response.code != 200 if response.code == 400 && json_error_response.nil? == false && json_error_response["code"] == 10 diff --git a/config/application.rb b/config/application.rb index bb412f4f..771aeb46 100644 --- a/config/application.rb +++ b/config/application.rb @@ -2,6 +2,10 @@ require "rails/all" +if defined?(Rails::Server) && Rails.env.development? + require "debug/open_nonstop" +end + # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups)