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

Properly Remove TempFiles #54

Merged
merged 2 commits into from
Feb 3, 2025
Merged

Properly Remove TempFiles #54

merged 2 commits into from
Feb 3, 2025

Conversation

LTDakin
Copy link
Contributor

@LTDakin LTDakin commented Jan 30, 2025

Fixes #53

Adds the context manager decorator to the create_fits, create_tif, and create_jpgs functions.
This way I can return the file paths to wherever called the function and when its done clean them up.

Also made sure to specify the TEMP_FITS_DIR since there is a cronjob Matt wrote to clean that one, the default was just /tmp. Even though the files are deleted properly now this is just to be extra safe.

Other changes

  • Added an error handler to the line profile for a future debugging
  • deleted an unused function

Example of the context manger properly cleaning the output files out after they're uploaded to s3, inputs remain in the tmp since they're cached to be used in future operations. (cleaned out in an hour)

Screen.Recording.2025-01-29.at.4.53.14.PM.mov

@LTDakin LTDakin added the bug label Jan 30, 2025
@LTDakin LTDakin requested a review from jnation3406 January 30, 2025 01:05
@LTDakin LTDakin self-assigned this Jan 30, 2025
Copy link
Contributor

@jnation3406 jnation3406 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good to me

@LTDakin LTDakin merged commit ffbb461 into main Feb 3, 2025
3 checks passed
@LTDakin LTDakin deleted the fix/remove-temp-files branch February 3, 2025 23:07
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.

OOM errors crashing containers
2 participants