Compare commits
1 commit
main
...
codex/find
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c07c67b662 |
1 changed files with 3 additions and 2 deletions
|
|
@ -23,14 +23,15 @@ class CustomCacheManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final allFiles = cacheDir.listSync(recursive: true).toList();
|
final allFiles =
|
||||||
|
cacheDir.listSync(recursive: true).whereType<File>().toList();
|
||||||
|
|
||||||
await _repo.open();
|
await _repo.open();
|
||||||
final cachedObjects = await _repo.getAllObjects();
|
final cachedObjects = await _repo.getAllObjects();
|
||||||
final dbFiles = cachedObjects.map((e) => e.relativePath).toSet();
|
final dbFiles = cachedObjects.map((e) => e.relativePath).toSet();
|
||||||
|
|
||||||
final orphanedFiles = allFiles.where((file) {
|
final orphanedFiles = allFiles.where((file) {
|
||||||
final relativePath = file.path.split('$key/').last;
|
final relativePath = file.path.replaceFirst('${cacheDir.path}/', '');
|
||||||
return !dbFiles.contains(relativePath);
|
return !dbFiles.contains(relativePath);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue