Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
15 lines
473 B
Swift
15 lines
473 B
Swift
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)
|
|
}
|
|
}
|