Ensure cache directory exists when attempting to use it - #274
Open
pR0Ps wants to merge 1 commit into
Open
Conversation
Even though the cache directory is created when the object is initialized, it's possible for it to be deleted while the program is running, leading to failures to create the temporary files.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #274 +/- ##
=======================================
Coverage 95.56% 95.56%
=======================================
Files 54 54
Lines 4310 4311 +1
=======================================
+ Hits 4119 4120 +1
Misses 191 191 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
Hello! Since a transcode can take some time, isn't there a window where a cleanup can happen between the temporary file creation and its rename on line 154? That would most likely raise the same kind of error there too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Even though the cache directory is created when the object is initialized, it's possible for it to be deleted while the program is running, leading to failures to create the temporary files.
In my specific case, I have the cache set up to use a subdirectory of
/tmp, which is occasionally cleaned up by the operating system. This leads to errors like the following when attempting to cache transcodes or extract album art: