From 0507b5291f32cf41774f77d05587483e8f5c669b Mon Sep 17 00:00:00 2001 From: Richard Hallett Date: Mon, 27 Aug 2018 16:31:51 +0200 Subject: [PATCH] get_url should use the hndl server from env. --- app/models/concerns/helpable.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/helpable.rb b/app/models/concerns/helpable.rb index 059283858..ee0c48f1c 100644 --- a/app/models/concerns/helpable.rb +++ b/app/models/concerns/helpable.rb @@ -67,7 +67,7 @@ def register_url end def get_url - url = "https://doi.org/api/handles/#{doi}?index=1" + url = "#{ENV['HANDLE_URL']}/api/handles/#{doi}?index=1" response = Maremma.get(url, ssl_self_signed: true, timeout: 10) if response.status == 200 @@ -116,7 +116,7 @@ def get_dois(options={}) response else text = "Error " + response.body["errors"].inspect - + logger = Logger.new(STDOUT) logger.error "[Handle] " + text User.send_notification_to_slack(text, title: "Error #{response.status.to_s}", level: "danger") unless Rails.env.test?