Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving file handle life cycle #5831

Merged
merged 1 commit into from
Sep 2, 2022
Merged

Commits on Sep 2, 2022

  1. Improving file handle life cycle

    What follows is speculation, but informed by the [File.open documentation][1].
    
    Prior to this commit, there was no guarantee that once we opened a file,
    we would close it.  This means that as this process ran we could
    accumulate open file handles on the system.
    
    By switching to the `File.open { |file| ... }` approach the
    aforementioned block will ensure that we close the file when the block
    terminates.
    
    Note: This came about in trying to debug the callstack for
    [ruby2-6 (65220) - samvera/hyrax][2]
    
    [1]:https://ruby-doc.org/core-2.7.2/File.html#method-c-open
    [2]:https://app.circleci.com/pipelines/github/samvera/hyrax/8274/workflows/26246722-a8e8-43a0-a1fa-7b32db139856/jobs/65220
    jeremyf committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    3a5cff3 View commit details
    Browse the repository at this point in the history