Skip to content

Conversation

@majiayu000
Copy link

Summary

  • Add _delete_physical_files method to clean up cache files on document deletion
  • Delete chunk cache files from KH_CHUNKS_OUTPUT_DIR
  • Delete markdown cache files from KH_MARKDOWN_OUTPUT_DIR
  • Graceful error handling to prevent deletion failures from blocking the operation

Test plan

  • Added unit tests for cache file deletion scenarios
  • Tests cover: file deletion, directory deletion, empty filename, missing dirs

Fixes #717

Fixes Cinnamon#717

When deleting documents via the UI, the deletion now also removes:
- Chunk cache files from KH_CHUNKS_OUTPUT_DIR
- Markdown cache files from KH_MARKDOWN_OUTPUT_DIR

This prevents storage bloat from orphaned cache files that were
previously left behind after document deletion.

Signed-off-by: majiayu000 <[email protected]>
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.

[BUG] Physical Files Not Deleted When Removing Documents via UI

1 participant