-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Use other method to enumerate contents, which causing crash(maybe only occurred for archved build) #620
Conversation
I don't know why I thought these problems are involved, but it seems to be other problems. |
Codecov Report
@@ Coverage Diff @@
## master #620 +/- ##
==========================================
- Coverage 75.67% 75.63% -0.04%
==========================================
Files 21 21
Lines 2269 2266 -3
==========================================
- Hits 1717 1714 -3
Misses 552 552 Continue to review full report at Codecov.
|
Sources/ImageCache.swift
Outdated
if !onlyForCacheSize { | ||
cachedFiles[fileUrl] = resourceValues | ||
} | ||
for fileUrl in (try? fileManager.contentsOfDirectory(at: diskCacheURL, includingPropertiesForKeys: Array(resourceKeys), options: FileManager.DirectoryEnumerationOptions.skipsHiddenFiles)) ?? [] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the original bad code, but FileManager.DirectoryEnumerationOptions.skipsHiddenFiles
could be simplified to .skipsHiddenFiles
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Could you simplify the options before we could merge it? Thanks!
…y occurred for archved build) - Fix #619
Thanks, if it is okay, merge please |
Great! |
ImageCache.travelCachedFiles(onlyForCacheSize : Bool) -> (urlsToDelete : [URL], diskCacheSize : UInt, cachedFiles : [URL : URLResourceValues])
#619