Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
738 stars 427 forks source link

Stale period not working properly #452

Open RezaMahdinezhad opened 2 months ago

RezaMahdinezhad commented 2 months ago

` Im using flutter_cache_manager: ^3.3.1 and the stale period its not working properly. its not automatically deleting the files.

final cacheManager = CacheManager(
  Config(
    id,
    stalePeriod: Duration(seconds: 60),
    maxNrOfCacheObjects: 10,
  ),
);

try {
  final fileStream = cacheManager.getFileStream(_syncMusicUrl);

  await for (var response in fileStream) {
    if (response is FileInfo) {
      _cacheMusicPath = response.file.path;

      return true;
    } else if (response is DownloadProgress) {}
  }
  return false;
} catch (error) {
  syncSituation.value = "sync";
  update();
  return false;
} }`