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

Make sure files are closed before deleting #77

Open
ajkiessl opened this issue Jul 24, 2024 · 0 comments
Open

Make sure files are closed before deleting #77

ajkiessl opened this issue Jul 24, 2024 · 0 comments

Comments

@ajkiessl
Copy link
Contributor

Some of our imports temporarily store a file while running. The #clear_tmp_files method in app/jobs/application_job is designed to clear out these tmp files before and after the integrations run. If there's an error while an integration is running, there's the chance the temporarily stored file is still open. So when we go to delete the file we get this error:

 Device or resource busy @ apply2files

We should make sure the file to be deleted is closed before deleting with something like this:

 f.close unless f.nil? or f.closed?

There may be instances other than #clear_tmp_files where temporary files are deleted. We should do the same there.

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

No branches or pull requests

1 participant