Skip to content

Commit

Permalink
Merge pull request #65 from korun/ensure-file-closed
Browse files Browse the repository at this point in the history
Fix unclosed file descriptor after read_from_cache
  • Loading branch information
spk committed Sep 7, 2020
2 parents 62df981 + e693585 commit 4dc5ab9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/money/bank/open_exchange_rates_bank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def read_from_cache
result = if cache.is_a?(Proc)
cache.call(nil)
elsif File.exist?(cache.to_s)
File.open(cache).read
File.read(cache)
end
result if valid_rates?(result)
end
Expand Down

0 comments on commit 4dc5ab9

Please sign in to comment.