Skip to content

Commit

Permalink
[refactor] #13 디스크 캐시 경로 확인
Browse files Browse the repository at this point in the history
  • Loading branch information
pearhyunjin committed Jan 14, 2025
1 parent 79cc01e commit 0c7e2d2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions SniffMeet/SniffMeet/Source/Persistence/CacheManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ final class ImageNSCacheManager {
try? fileManager.delete(forKey: oldestKey)
}
}

func printDiskCacheDirectory() {
let cacheDirectory = ImageNSCacheManager.shared.cacheDirectoryPath
print("Disk cache directory: \(cacheDirectory.path)")

if let contents = try? FileManager.default.contentsOfDirectory(atPath: cacheDirectory.path) {
print("Disk cache contents: \(contents)")
}
}
}

extension ImageNSCacheManager: ImageCacheable {
Expand All @@ -99,6 +108,7 @@ extension ImageNSCacheManager: ImageCacheable {

saveMemoryCache(urlString: urlString, cacheableImage: cacheableImage)
saveDiskCache(urlString: urlString, cacheableImage: cacheableImage)
printDiskCacheDirectory()
}

func image(urlString: String) -> CacheableImage? {
Expand Down

0 comments on commit 0c7e2d2

Please sign in to comment.