remove method

Future<void> remove()

Implementation

Future<void> remove() async {
  // Try to acquire lock with longer timeout for remove operations
  if (!await _acquireLock(timeout: Duration(seconds: 5))) {
    // Log warning but still attempt to remove files
    httpCacheLogger.warning('Failed to acquire lock for removing cache for $url - attempting removal anyway');
  }

  try {
    if (await _file.exists()) {
      await _file.delete();
    }
    await _blob.remove();
  } catch(_) {

  } finally {
    _valid = false;
    // Always release lock
    await _releaseLock();
  }
}