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

Use a temporary directory to manage temporary files #117

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

bzar
Copy link
Contributor

@bzar bzar commented Aug 7, 2023

Fixes #116

  • Change temporary file management to utilize a single TemporaryDirectory per job instead of multiple NamedTemporaryFiles. The files have well-defined names within this directory.
  • Keep the initial temp file open only as long as it's being written
  • Wrap the entire job within a with context to ensure the temporary directory is removed when the job exits for any reason.
  • Add missing decimal import required by DatastoreEncoder

Financed by Finland's open data portal opendata.fi. Find all Finnish open data at https://www.opendata.fi/en.
The Service is provided by the Digital and Population Data Services Agency (https://dvv.fi/en/).

@jqnatividad jqnatividad merged commit 25215ea into dathere:master Aug 16, 2023
2 checks passed
tino097 pushed a commit that referenced this pull request Sep 7, 2023
Use a temporary directory to manage temporary files

LGTM! Thanks @bzar for cleaning up the temp file handling!
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.

Temporary files are not always removed
2 participants