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

refactor clearing HDD cache to remove empty directories #289

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

stklcode
Copy link
Contributor

@stklcode stklcode commented Aug 21, 2023

Initially discussed in PR #286 and reported by @raffaelj

My main concern was to delete the empty folder after invalidating the page cache.
[...]
I think, it would be better to add an additional check, if the folder is empty. If so, the empty folder should be deleted by default - regardless of the $recursive = false option.


Proposed solution:

We opt out early, if a directory was already empty before and delete emptied directories only in recursive mode.

Remove the early return and the additional condition, so we do not leave behind empty directories.

We opt out early, if a directory was already empty before and delete
emptied directories only in recursive mode.
Remove the early return and the additional condition, so we do not leave
behind empty directories.
Copy link

sonarcloud bot commented Mar 29, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@stklcode stklcode merged commit 429f4e3 into develop Mar 29, 2024
15 checks passed
@stklcode stklcode deleted the fix/empty-dir branch March 29, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant