Trigger an HTMLMetadata download not more than once an hour (per URL).

This commit is contained in:
Brent Simmons
2024-10-15 21:25:32 -07:00
parent 776adcb63b
commit 20b66e1a5b
4 changed files with 62 additions and 38 deletions

View File

@@ -16,6 +16,10 @@ public extension Date {
return addingTimeInterval(0.0 - TimeInterval(days: days))
}
func bySubtracting(hours: Int) -> Date {
return addingTimeInterval(0.0 - TimeInterval(hours: hours))
}
func byAdding(days: Int) -> Date {
return addingTimeInterval(TimeInterval(days: days))
}
@@ -26,4 +30,8 @@ public extension TimeInterval {
init(days: Int) {
self.init(days * 24 * 60 * 60)
}
init(hours: Int) {
self.init(hours * 60 * 60)
}
}