[JS IC] Support deleted files in IC cache invalidator

- support them in test too
This commit is contained in:
Roman Artemev
2021-12-17 06:38:19 +03:00
committed by teamcity
parent 2ace13a904
commit 9b49f0eb70
3 changed files with 35 additions and 9 deletions
@@ -184,7 +184,8 @@ class PersistentCacheProviderImpl(private val cachePath: String) : PersistentCac
}
override fun filePaths(): Iterable<String> {
return File(cachePath).listFiles()!!.filter { it.isDirectory }.mapNotNull { f ->
val files = File(cachePath).listFiles() ?: return emptyList()
return files.filter { it.isDirectory }.mapNotNull { f ->
val fileInfo = File(f, fileInfoFile)
if (fileInfo.exists()) {
fileInfo.readLines()[0]