Skip to content

Commit

Permalink
rename generate_cache_key to prevent conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jan 17, 2025
1 parent 6bc4415 commit 089c595
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/sparql/client/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def invalidate(graphs)
end

def key(query, options)
generate_cache_key(query, options)
query_cache_key(query, options)
end

def self.generate_cache_key(string, from)
Expand Down Expand Up @@ -78,9 +78,9 @@ def cache_key(query)
SPARQL::Client::Cache.generate_cache_key(query.to_s, from)
end

def generate_cache_key(query, options)
def query_cache_key(query, options)
if options[:graphs] || query.options[:graphs]
cache_key = SPARQL::Client::Query.generate_cache_key(query.to_s, options[:graphs] || query.options[:graphs])
cache_key = SPARQL::Client::Cache.generate_cache_key(query.to_s, options[:graphs] || query.options[:graphs])
else
cache_key = cache_key(query)
end
Expand All @@ -92,7 +92,7 @@ def cached_query_response(query, options)

if @redis_cache && (query.instance_of?(SPARQL::Client::Query) || options[:graphs])

cache_key = generate_cache_key(query, options)
cache_key = query_cache_key(query, options)
cache_response = @redis_cache.get(cache_key[:query])

if options[:reload_cache] and options[:reload_cache] == true
Expand Down

0 comments on commit 089c595

Please sign in to comment.