Skip to content

Commit

Permalink
Merge pull request #5831 from samvera/improving-file-handle-lifecycle
Browse files Browse the repository at this point in the history
Improving file handle life cycle
  • Loading branch information
dlpierce authored Sep 2, 2022
2 parents 76104da + 3a5cff3 commit f9bc8c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/services/hyrax/local_file_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ class LocalFileService
# @param [Hash] _options
# @yield [File] opens the file and yields it to the block
def self.call(file_name, _options)
yield File.open(file_name)
File.open(file_name) do |file|
yield(file)
end
end
end
end

0 comments on commit f9bc8c8

Please sign in to comment.