getOldObjects method

  1. @override
Future<List<CacheObject>> getOldObjects(
  1. Duration maxAge
)
override

Returns a list of CacheObject that are older than maxAge

Implementation

@override
Future<List<CacheObject>> getOldObjects(Duration maxAge) async {
  final oldestTimestamp = DateTime.now().subtract(maxAge);
  return _cacheObjects.values
      .where(
        (element) => element.touched!.isBefore(oldestTimestamp),
      )
      .toList();
}