Skip to content

Commit

Permalink
Update for new Grigori
Browse files Browse the repository at this point in the history
  • Loading branch information
cguess committed Jun 3, 2024
1 parent ab98e63 commit 35ead8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/models/scrape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 35ead8d

Please sign in to comment.