invalidateCachedStatisticsAsync method

Future<void> invalidateCachedStatisticsAsync(
  1. String? statType
)

Remove the cached statistics asynchronously

For synchronous version, see invalidateCachedStatistics.

If statType is null, all statistic caches are deleted, otherwise only the specified cache is deleted.

Implementation

Future<void> invalidateCachedStatisticsAsync(String? statType) async {
  try {
    if (statType != null) {
      await (_access.stats >>> '$statType.cache').delete();
    } else {
      await Future.wait([
        (_access.stats >>> 'length.cache').delete(),
        (_access.stats >>> 'size.cache').delete(),
      ]);
    }
    // ignore: empty_catches
  } catch (e) {}
}