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 {
  return CacheObject.fromMapList(await db!.query(
    _tableCacheObject,
    where: '${CacheObject.columnTouched} < ?',
    columns: null,
    whereArgs: [DateTime.now().subtract(maxAge).millisecondsSinceEpoch],
    limit: 100,
  ));
}