Skip to content

Commit

Permalink
Merge pull request #39 from apainintheneck/fix-caching-bug
Browse files Browse the repository at this point in the history
Fix caching bug
  • Loading branch information
apainintheneck authored Feb 21, 2024
2 parents dd2e76d + f33e5cd commit 9aea288
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/atlasq/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ def self.get(full_name)
@get ||= {}
@get.fetch(full_name) do
path = "#{CACHE_DIR}/#{full_name}"

content = File.read(path)
content = JSON.parse(content) if full_name.end_with?(".json")

case full_name
when /\.json$/
JSON.parse(content)
else
content
end
@get[full_name] = content
end
end
end
Expand Down

0 comments on commit 9aea288

Please sign in to comment.