clearApp method
Implementation
@override
Future<void> clearApp(String appId) async {
final normalizedAppId = MiniProgramCacheManager.namespacedKey(
appId: appId,
bucket: MiniProgramCacheBucket.data,
key: '_probe',
).split('/')[1];
_entries.removeWhere((_, entry) => entry.appId == normalizedAppId);
if (!await _directory.exists()) {
return;
}
for (final file in await _entryFiles()) {
final entry = await _readEntry(file);
if (entry == null) {
await _safeDelete(file);
continue;
}
if (entry.appId == normalizedAppId) {
_entries.remove(entry.namespacedKey);
await _safeDelete(file);
}
}
}