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

close io object when fixture writing has completed #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tagCincy
Copy link

So typically, when passing a block to File.open, the IO object with automatically close when the block terminates. However, we have notice when attempting to write fixtures for largish database dumps that the IO stream is closing before the last few strings are written.

I believe the cause of this is here:

https://github.com/mbleigh/seed-fu/blob/master/lib/seed-fu/writer.rb#L96-L98

Basically, the ensure is killing the the stream before the last chunks have been written to the file by niling it.

I am not sure this solution is the best, but it solved our issue. I might take a stab at refactoring this code later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant