File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
lib/ontologies_api_client Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ def federated_get(params = {}, &link)
2727
2828 main_thread_locals . each { |key , value | Thread . current [ key ] = value }
2929 begin
30- HTTP . get ( link . call ( conn . url_prefix . to_s . chomp ( '/' ) ) , params , connection : conn )
30+ portal_params = params [ portal_name . to_s . downcase ] || params
31+ HTTP . get ( link . call ( conn . url_prefix . to_s . chomp ( '/' ) ) , portal_params , connection : conn )
3132 rescue Exception => e
3233 Rails . cache . write ( "federation_portal_up_#{ portal_name } " , false , expires_in : 10 . minutes )
3334 [ OpenStruct . new ( errors : "Problem retrieving #{ link . call ( conn . url_prefix . to_s . chomp ( '/' ) ) || conn . url_prefix } " ) ]
@@ -39,10 +40,14 @@ def federated_get(params = {}, &link)
3940
4041
4142
42- def request_portals ( params = { } )
43- federate = params . delete ( :federate ) || ::RequestStore . store [ :federated_portals ]
43+ def federated_portals_names ( params = { } )
44+ params [ :federate ] || ::RequestStore . store [ :federated_portals ]
45+ end
4446
47+ def request_portals ( params = { } )
48+ federate = federated_portals_names ( params )
4549 portals = [ LinkedData ::Client ::HTTP . conn ]
50+ params . delete ( :federate )
4651
4752 if federate . is_a? ( Array )
4853 portals += LinkedData ::Client ::HTTP . federated_conn
You can’t perform that action at this time.
0 commit comments