Removed commented code.
This commit is contained in:
parent
2e5e90b715
commit
9181037a6e
@ -55,7 +55,6 @@ public class CachedData: Codable {
|
|||||||
private override init() {}
|
private override init() {}
|
||||||
|
|
||||||
@objc public func save(data: [String: AnyHashable], forKey key: String, path: URL, expirationDate: Date) throws {
|
@objc public func save(data: [String: AnyHashable], forKey key: String, path: URL, expirationDate: Date) throws {
|
||||||
//print("Save Call**: \(path)")
|
|
||||||
let cachedData = CachedData(data: data, expirationDate: expirationDate)
|
let cachedData = CachedData(data: data, expirationDate: expirationDate)
|
||||||
do {
|
do {
|
||||||
try FileManager.default.createDirectory(atPath: path.deletingLastPathComponent().relativePath, withIntermediateDirectories: true, attributes: [.protectionKey: FileProtectionType.complete])
|
try FileManager.default.createDirectory(atPath: path.deletingLastPathComponent().relativePath, withIntermediateDirectories: true, attributes: [.protectionKey: FileProtectionType.complete])
|
||||||
@ -71,7 +70,6 @@ public class CachedData: Codable {
|
|||||||
|
|
||||||
@objc public func load(forKey key: String, path: URL) throws -> [String: AnyHashable] {
|
@objc public func load(forKey key: String, path: URL) throws -> [String: AnyHashable] {
|
||||||
do {
|
do {
|
||||||
//print("Load Call**: \(path)")
|
|
||||||
let data = try Data(contentsOf: path)
|
let data = try Data(contentsOf: path)
|
||||||
let decodedCachedData = try JSONDecoder().decode(CachedData.self, from: data)
|
let decodedCachedData = try JSONDecoder().decode(CachedData.self, from: data)
|
||||||
if Date() < decodedCachedData.expirationDate {
|
if Date() < decodedCachedData.expirationDate {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user