getStaleRoutes method

List<RouteEntry<T>> getStaleRoutes(
  1. Duration threshold
)

Gets routes that need updating (older than threshold)

Implementation

List<RouteEntry<T>> getStaleRoutes(Duration threshold) {
  final cutoff = DateTime.now().subtract(threshold);
  return routes.values
      .where((route) => route.lastUpdate.isBefore(cutoff))
      .toList();
}