File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
flutter_cache_manager/lib/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -154,9 +154,11 @@ class CacheStore {
154154 final provider = await _cacheInfoRepository;
155155 final toRemove = < int > [];
156156 final allObjects = await provider.getAllObjects ();
157+ var futures = < Future > [];
157158 for (final cacheObject in allObjects) {
158- _removeCachedFile (cacheObject, toRemove);
159+ futures. add ( _removeCachedFile (cacheObject, toRemove) );
159160 }
161+ await Future .wait (futures);
160162 await provider.deleteAll (toRemove);
161163 }
162164
@@ -180,7 +182,7 @@ class CacheStore {
180182 _memCache.remove (cacheObject.key);
181183 }
182184 if (_futureCache.containsKey (cacheObject.key)) {
183- _futureCache.remove (cacheObject.key);
185+ await _futureCache.remove (cacheObject.key);
184186 }
185187 final file = io.File (cacheObject.relativePath);
186188
You can’t perform that action at this time.
0 commit comments