mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-21 15:50:59 +00:00
Set retry and continue in background image options
This commit is contained in:
parent
19963de055
commit
e245569e1a
1 changed files with 8 additions and 0 deletions
|
@ -17,6 +17,14 @@ extension ImageCacheConfiguration {
|
|||
SDImageCache.defaultDiskCacheDirectory = Self.imageCacheDirectoryURL?.path
|
||||
ImageDiskCache.service = try ImageSerializationService(environment: environment)
|
||||
SDImageCacheConfig.default.diskCacheClass = ImageDiskCache.self
|
||||
SDWebImageManager.shared.optionsProcessor = SDWebImageOptionsProcessor { _, options, context in
|
||||
var mutableOptions = options
|
||||
|
||||
mutableOptions.insert(.retryFailed)
|
||||
mutableOptions.insert(.continueInBackground)
|
||||
|
||||
return SDWebImageOptionsResult(options: options, context: context)
|
||||
}
|
||||
|
||||
if let legacyImageCacheDirectoryURL = Self.legacyImageCacheDirectoryURL,
|
||||
FileManager.default.fileExists(atPath: legacyImageCacheDirectoryURL.path) {
|
||||
|
|
Loading…
Reference in a new issue