Skip to content

Temp File Cleanup - T415715 Micro-Task#89

Open
Mariam22-hub wants to merge 4 commits intoindictechcom:masterfrom
Mariam22-hub:Temp-file-cleanup-T415715
Open

Temp File Cleanup - T415715 Micro-Task#89
Mariam22-hub wants to merge 4 commits intoindictechcom:masterfrom
Mariam22-hub:Temp-file-cleanup-T415715

Conversation

@Mariam22-hub
Copy link
Copy Markdown

This PR addresses this backend improvement tasks:

Prevent resource leaks and ensure reliable cleanup of temporary upload files

Key Changes

  • Safe file handling
    • Added shared utility function for safe temp file deletion
    • Catches OSError and logs a WARNING with the path and error
    • Write failure now calls safe_delete_temp_file(local_path) before raising ImageDownloadError
    • HTTP upload error, CSRF failure...etc, call safe_delete_temp_file(local_path) before returning an error

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