diff --git a/src/main/kotlin/net/taehui/twilight/system/DB.kt b/src/main/kotlin/net/taehui/twilight/system/DB.kt index 0ce1329..cf8841f 100644 --- a/src/main/kotlin/net/taehui/twilight/system/DB.kt +++ b/src/main/kotlin/net/taehui/twilight/system/DB.kt @@ -24,6 +24,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.atomic.AtomicInteger import java.util.stream.Stream +import java.util.stream.StreamSupport import kotlin.collections.ArrayList import kotlin.io.path.inputStream import kotlin.math.pow @@ -637,7 +638,7 @@ return logFuture { pool.connection.use { Files.newDirectoryStream(TwilightComponent.COMMENT_ENTRY_PATH).use { commentEntryPaths -> - commentEntryPaths.forEach { commentEntryPath -> + StreamSupport.stream(commentEntryPaths.spliterator(), true).forEach { commentEntryPath -> Files.list(commentEntryPath).use { commentFilePaths -> commentFilePaths.forEach { commentFilePath -> val commentID = FilenameUtils.removeExtension(commentFilePath.fileName.toString())