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

FileCache: Clean up empty directories on remove() #3162

Closed
lukasbestle opened this issue Feb 19, 2021 · 1 comment · Fixed by #3199
Closed

FileCache: Clean up empty directories on remove() #3162

lukasbestle opened this issue Feb 19, 2021 · 1 comment · Fixed by #3199
Assignees
Labels
type: enhancement ✨ Suggests an enhancement; improves Kirby
Milestone

Comments

@lukasbestle
Copy link
Member

When a cache item is removed, it may leave behind an empty directory.

The FileCache::remove() method should check if the directory the item was in is now empty. If it is, it should delete the empty directory. Then it should check the same for the next level up until the root is reached (which should not be deleted).

@lukasbestle lukasbestle added the type: enhancement ✨ Suggests an enhancement; improves Kirby label Feb 19, 2021
@lukasbestle lukasbestle added this to the 3.5.x milestone Feb 19, 2021
@afbora afbora self-assigned this Mar 10, 2021
@afbora afbora linked a pull request Mar 10, 2021 that will close this issue
4 tasks
@afbora afbora modified the milestones: 3.5.x, 3.5.4 Mar 12, 2021
afbora added a commit that referenced this issue Mar 13, 2021
Since there may be a performance problem, an iterative solution that suggested by @lukasbestle  has been applied instead of recursive.
bastianallgeier added a commit that referenced this issue Mar 17, 2021
…pty-directories

FileCache: Clean up empty directories on remove() #3162
@bastianallgeier
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement ✨ Suggests an enhancement; improves Kirby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants