File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
lib/ontologies_api_client Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ def federated_get(params = {}, &link)
3232 HTTP . get ( link . call ( conn . url_prefix . to_s . chomp ( '/' ) ) , portal_params , connection : conn )
3333 rescue Exception => e
3434 HTTP . log ( "Error in federation #{ portal_name } is down status cached for 10 minutes" )
35+ Rails . cache . write ( "federation_portal_up_#{ portal_name } " , false , expires_in : 10 . minutes ) unless internal_call? ( conn )
3536 [ OpenStruct . new ( errors : "Problem retrieving #{ link . call ( conn . url_prefix . to_s . chomp ( '/' ) ) || conn . url_prefix } " ) ]
3637 end
3738 end
@@ -61,6 +62,9 @@ def request_portals(params = {})
6162 portals
6263 end
6364
65+ def internal_call? ( conn )
66+ conn . url_prefix . to_s . start_with? ( LinkedData ::Client ::HTTP . conn . url_prefix . to_s )
67+ end
6468
6569 def portal_name_from_id ( id )
6670 LinkedData ::Client ::HTTP . federated_conn . find { |_ , value | value . url_prefix . to_s . eql? ( id ) } &.first || ''
You can’t perform that action at this time.
0 commit comments