isStale method

bool isStale(
  1. String table, {
  2. Duration maxAge = const Duration(hours: 24),
})

Returns true if stats for table are stale (older than maxAge).

Implementation

bool isStale(String table,
    {Duration maxAge = const Duration(hours: 24)}) {
  final ts = _stats[table];
  if (ts == null) return true;
  return DateTime.now().difference(ts.collectedAt) > maxAge;
}