Fix catching exception while building the content tree

This commit is contained in:
xis 2023-10-23 20:04:28 +02:00
parent 4f076109b5
commit 23e02c1b6f

View file

@ -87,12 +87,14 @@ class NextcloudDB(
children.filter { f -> f.mimetype == folderMimeType }
.forEach { folder -> n.addNode(asNode(folder)) }
try {
children.filter { f -> f.mimetype != folderMimeType }
.forEach { file -> n.addItem(asItem(file)) }
} catch (e: Exception) {
logger.warn(e.message)
}
children.filter { f -> f.mimetype != folderMimeType }
.forEach { file ->
runCatching {
n.addItem(asItem(file))
}.recover {
logger.warn(it.message)
}
}
}
fun maxMtime(): Long = filecacheRepository.findFirstByOrderByStorageMtimeDesc().storageMtime