getAll method

  1. @override
Future<List<FailedJob>> getAll({
  1. int? limit,
  2. int? offset,
})
override

Get all failed jobs

Implementation

@override
Future<List<FailedJob>> getAll({int? limit, int? offset}) async {
  var jobs = _jobs.values.toList()
    ..sort((a, b) => b.failedAt.compareTo(a.failedAt));

  if (offset != null) {
    jobs = jobs.skip(offset).toList();
  }

  if (limit != null) {
    jobs = jobs.take(limit).toList();
  }

  return jobs;
}