forked from firka/firka
tt: update cache retention to 4 months
This commit is contained in:
@@ -318,12 +318,12 @@ class KretaClient {
|
||||
}
|
||||
}
|
||||
|
||||
// only cache stuff in a 1 month frame
|
||||
// only cache stuff 4 months ago and a week in advance
|
||||
if (from.millisecondsSinceEpoch >=
|
||||
now.subtract(Duration(days: 30)).millisecondsSinceEpoch) {
|
||||
now.subtract(Duration(days: 120)).millisecondsSinceEpoch) {
|
||||
if (to == null ||
|
||||
to.millisecondsSinceEpoch <=
|
||||
now.add(Duration(days: 30)).millisecondsSinceEpoch) {
|
||||
now.add(Duration(days: 7)).millisecondsSinceEpoch) {
|
||||
await isar.writeTxn(() async {
|
||||
await storeCache(resp, cacheKey);
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@ Future<void> resetOldHomeworkCache(Isar isar) async {
|
||||
var date = getDate(week.cacheKey!);
|
||||
|
||||
if (date.millisecondsSinceEpoch <
|
||||
now.subtract(Duration(days: 30)).millisecondsSinceEpoch) {
|
||||
now.subtract(Duration(days: 120)).millisecondsSinceEpoch) {
|
||||
weeksToRemove.add(week.cacheKey!);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ Future<void> resetOldTimeTableCache(Isar isar) async {
|
||||
var date = getDate(week.cacheKey!);
|
||||
|
||||
if (date.millisecondsSinceEpoch <
|
||||
now.subtract(Duration(days: 30)).millisecondsSinceEpoch) {
|
||||
now.subtract(Duration(days: 120)).millisecondsSinceEpoch) {
|
||||
weeksToRemove.add(week.cacheKey!);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user