mirror of https://github.com/cirruslabs/tart.git
Fix `prune --older-than` deleting all cache (#549)
* Fix `prune --older-than` * Update Sources/tart/Commands/Prune.swift Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com> --------- Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
This commit is contained in:
parent
63b74f407b
commit
8653ca4115
|
|
@ -34,7 +34,7 @@ struct Prune: AsyncParsableCommand {
|
|||
// Clean up cache entries based on last accessed date
|
||||
if let olderThan = olderThan {
|
||||
let olderThanInterval = Int(exactly: olderThan)!.days.timeInterval
|
||||
let olderThanDate = Date().addingTimeInterval(olderThanInterval)
|
||||
let olderThanDate = Date() - olderThanInterval
|
||||
|
||||
try Prune.pruneOlderThan(olderThanDate: olderThanDate)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue