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

Feature/ghostbust dead symlinks #579

Merged

Conversation

alex-phillips
Copy link
Contributor

Resolves #578

A couple of caveats here: I had to manually delete the 'big' file path even though we are calling ->delete() on the photo because inside the predelete method, Storage::exists actually returns false if you pass in a dead symlink. So a predelete and delete is not enough here, have to manually unlink the dead symlink itself.

Something to consider: should this be an additional flag we pass into the ghostbuster command? I'm thinking in the event that images are mounted on an external drive, NFS, whatever and are 'temporarily' unavailable. Just something to keep in mind.

@alex-phillips alex-phillips force-pushed the feature/ghostbust-dead-symlinks branch from 0835160 to 8683ac9 Compare May 19, 2020 22:24
@codecov-commenter
Copy link

codecov-commenter commented May 19, 2020

Codecov Report

Merging #579 into master will decrease coverage by 0.12%.
The diff coverage is n/a.

Copy link
Member

@ildyria ildyria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested. LGTM (minus the small editions).

@ildyria
Copy link
Member

ildyria commented May 19, 2020

should this be an additional flag we pass into the ghostbuster command? I'm thinking in the event that images are mounted on an external drive, NFS, whatever and are 'temporarily' unavailable. Just something to keep in mind.

I think this would be a good idea. This would allow the use of the command to remove ghosts files (which is usually safe) while retaining the ability to not modify the database (for the photos).

@alex-phillips
Copy link
Contributor Author

Changes made. Thanks!

@sonarcloud
Copy link

sonarcloud bot commented May 21, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.5% 2.5% Duplication

@alex-phillips
Copy link
Contributor Author

Anything else I need to tackle before this gets merged?

@ildyria ildyria merged commit 1ffc225 into LycheeOrg:master May 21, 2020
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.

[Enhancement] Ghostbuster command to clean up dead symlinks
3 participants