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

Core: Improve Cleanup Temporary Files in Chipmunk Home Directory #2142

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

AmmarAbouZor
Copy link
Member

This PR closes #2137

It improves cleaning up the temporary files (Logs and attachments) generated by an observe session with the following changes:

  • Cleanup function for individual sessions is called when the session is dropped instead of calling it explicitly, ensuring that it will be called even on panics or in integration tests.
  • Extend cleanup function for individual sessions to remove the attachments besides removing the main log file.
  • A general cleaning up function to scan the temporary directory in Chipmunk and remove all files and directories that are older than two months. This function will be called on start of Chipmunk and will run on a separate thread to avoid blocking the initialization of the app on cleaning up huge temporary directory

* Call cleaning up session files on dropping session state on ensure it
  will be called always (even with panics or integration tests.)
* Clean up attachments directory and its content if exists.
* Provide function to cleanup the temporary directory from entries
  that are older than two months old.
* Run this function each time Chipmunk starts on a separate thread to
  avoid blocking initialization thread on cleaning up large temporary
  directory
@AmmarAbouZor AmmarAbouZor merged commit 32d1dde into esrlabs:master Nov 6, 2024
2 checks passed
@AmmarAbouZor AmmarAbouZor deleted the cleanup_session branch November 6, 2024 13:43
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.

Improve Cleanup Session Temporary Files
2 participants