소스 검색

Calling calculateDiskStorageSize

Roman Podymov 3 년 전
부모
커밋
09a2496827
1개의 변경된 파일2개의 추가작업 그리고 9개의 파일을 삭제
  1. 2 9
      Sources/Cache/ImageCache.swift

+ 2 - 9
Sources/Cache/ImageCache.swift

@@ -822,15 +822,8 @@ open class ImageCache {
     open var diskStorageSize: UInt {
         get async throws {
             try await withCheckedThrowingContinuation { continuation in
-                ioQueue.async {
-                    do {
-                        let size = try self.diskStorage.totalSize()
-                        Task { @MainActor in continuation.resume(returning: size) }
-                    } catch let error as KingfisherError {
-                        Task { @MainActor in continuation.resume(throwing: error) }
-                    } catch {
-                        assertionFailure("The internal thrown error should be a `KingfisherError`.")
-                    }
+                calculateDiskStorageSize { result in
+                    continuation.resume(with: result)
                 }
             }
         }