Skip to content

Commit

Permalink
optimize the top level links call to be done only once
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jan 27, 2025
1 parent aea832f commit a21ccad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ontologies_api_client/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def method_missing(meth, *args, &block)
##
# Get all top-level links for the API
def top_level_links(link = LinkedData::Client.settings.rest_url)
HTTP.get(link)
@top_level_links ||= {}
@top_level_links[link] ||= HTTP.get(link)
end

##
Expand Down

0 comments on commit a21ccad

Please sign in to comment.