Skip to content

Commit

Permalink
Merge pull request #218 from ontoportal-lirmm/fix/fair-services-down-…
Browse files Browse the repository at this point in the history
…rescue

Fix: to rescue  fairness  service if is unreachable
  • Loading branch information
syphax-bouazzouni authored Mar 21, 2023
2 parents 5ab6228 + 2921f71 commit 17c589c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/helpers/fair_score_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ def get_fairness_service_url(apikey = user_apikey)
"#{$FAIRNESS_URL}?portal=#{$HOSTNAME.split('.')[0]}#{apikey.nil? || apikey.empty? ? '' : "&apikey=#{apikey}"}"
end
def get_fairness_json(ontologies_acronyms, apikey = user_apikey)
MultiJson.load(Faraday.get(get_fairness_service_url(apikey) + "&ontologies=#{ontologies_acronyms}&combined").body.force_encoding('ISO-8859-1').encode('UTF-8'))
begin
MultiJson.load(Faraday.get(get_fairness_service_url(apikey) + "&ontologies=#{ontologies_acronyms}&combined").body.force_encoding('ISO-8859-1').encode('UTF-8'))
rescue
Rails.logger.warn "FAIRness service issue unreachable"
{}
end
end

def get_fair_score(ontologies_acronyms, apikey = user_apikey)
Expand Down

0 comments on commit 17c589c

Please sign in to comment.