chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:05:33 +08:00
commit e25d789156
8165 changed files with 2004905 additions and 0 deletions
@@ -0,0 +1,14 @@
import Foundation
public enum ComputerSnapshotCachePolicy {
public static let maxEntries = 32
public static let maxAge: TimeInterval = 2 * 60
public static func isExpired(createdAt: Date, now: Date = Date()) -> Bool {
now.timeIntervalSince(createdAt) > maxAge
}
public static func shouldPrune(entryCount: Int, createdAt: Date, now: Date = Date()) -> Bool {
entryCount > maxEntries || isExpired(createdAt: createdAt, now: now)
}
}